-
-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatic localization integration (#20)
* Added automatic localization addition Settings now has a PoolStringArray of locales (in place of the constants) and a equally indexed PoolStringArray of language names. Localization files now are required to provide a name via the LANGUAGE_NAME key which must be in the first line of the file. SettingsDialog now automatically sets the items in the OptionButton. * Sorted languages alphabetically, with English on top Separated the adding of items to its own function. which adds them in alphabetical order, storing the original position in the id. Also changed the callback method for the OptionButton to use id and not index to set the locale. And initialized locales and language_names on declaration to clear warnings. * Moved colon To comply with project's coding style * Added ParseResult inner class in I18nParser Added a ParseResult class, which contains two PoolStringArrays, locales and language_names. load_files() now returns a ParseResult. * Changed 'not' to '!' * Fixed languages not appearing bug It was caused by trying to modify a class member of type PoolStringArray, which is passed by value and not by reference. Fix: add a setter method to the ParseResult class. Also used one method for both arrays, since elements should always be added in pairs. * Update i18n.md Updated docs to comply with new localization system Co-authored-by: Marcus Brummer <mbrlabs@users.noreply.github.com>
- Loading branch information
Showing
10 changed files
with
63 additions
and
29 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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