-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unity Localization Package Support #1042
Open
addie-lombardo
wants to merge
41
commits into
snozbot:develop
Choose a base branch
from
addie-lombardo:feature/unity-localization
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Unity Localization Package Support #1042
addie-lombardo
wants to merge
41
commits into
snozbot:develop
from
addie-lombardo:feature/unity-localization
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Created localization settings, locales, and added localized string referenced to localizable fungus components
also started work on a export/import system for getting changes from commands/string tables
still needs the ability to check for existing keys to modify them
Exposed nameTextString in character editor, made it so its actually used too, fixed a parsing error in the english text
… throw by SetLanguage if the same language that was already set was set
…-lombardo/fungus into feature/unity-localization
Fungus command data could not be exported in spreadsheets
also adds an advanced option to fix LocalizedString's references if you rename your entries
changed because the method in LocalizedString already named GetLocalizedString.
… feature/unity-localization
Removed support for using variable substitution to display localization entries since it isn't possible using the new system.
I would love to see this PR merged! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
![CleanShot 2021-12-09 at 09 16 50@2x](https://user-images.githubusercontent.com/25385583/145512585-04911ce2-8b46-4c1c-975a-e654b1534d3a.png)
Description
Hello! I recently released a commercial game with Fungus doing a lot of the heavy lifting including localization for dialogue. While this feature works as expected it proved to be difficult with larger projects so I wanted to create something that could be used from in small to large projects now that I have some free time. With the release of Unity 2021.2 and the public v1.0 release of the Unity Localization package I decided to reimplement Fungus's localization features to use the Localization package without removing the previous functionality in the codebase.
What is the current behavior?
The current localization workflow requires you to write all your dialogue first, export it using the Localization component and then reimport it after editing the CSV in an external program.
What is the new behavior?
The new localization workflow allows you to localize your content in two ways.
The first way is the configure the LocalizedString variable in any ILocalizable component (named localized%VARIABLENAME% eg. localizedStoryText, localizedText, etc.) this is great for dialog that is repeated in multiple say commands and you’d like to assign them all to the same localization entry.
![CleanShot 2021-12-09 at 12 30 37@2x](https://user-images.githubusercontent.com/25385583/145512713-0af3c9fb-51f7-4ff4-8a0d-c85bb9e8ebd5.png)

The second way is to automate the creation of entries and assigning of the LocalizedString variable using the new Localization component. The component doesn’t only allow you to export entries you can also import changes made to the string table back into fungus commands as well! Once exported to a string table you will be able to export to a variety of formats (CSV, Google Sheets, or XILFF) for external editing, all of which can be imported back in.
![CleanShot 2021-12-09 at 12 36 57@2x](https://user-images.githubusercontent.com/25385583/145513507-b34db314-f681-4573-a4e2-77f79b25b15a.png)

PR also includes the ability to localize to now localize VO clips in the Say command thanks to the support to be able to localize assets with the Localization package.
![CleanShot 2021-12-09 at 18 10 58 2@2x](https://user-images.githubusercontent.com/25385583/145513644-733587eb-322b-48c4-a46d-2f0564815267.png)

The new behavior includes two examples, a recreation of the original Localization example and a longer example which pulls dialogue from our game No Longer Home.
The old localization system can still be used, all you need to do is remove UNITY_LOCALIZATION under Custom Defines in the Player Settings to revert back to using the old system.
Important Notes
Other information
I recommend this tutorial for learning more about the basics and getting the Localization package setup.
Requires Unity 2021.2.0f1 to see the Localization package in the Package Manager but it can be installed in earlier editors by typing in com.unity.localization under “Add package from git URL” in the Package Manager in 2019.3 and later.
One feature I have not been able to reimplement yet (making the PR still a WIP) is Localization.SubstituteStrings() I would appreciate some help on context on what it does so I can implement it myself or get help.Edit: I have implemented this in commit 0d04f47. I've updated to title to remove [WIP] as it is now feature complete