summaryrefslogtreecommitdiffstats
path: root/core/translation.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Reorganized core/ directory, it was too fatty alreadyreduz2020-11-071-1303/+0
| | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* Updated Translation architecture to have TranslationPO, did some commit ↵SkyJJ2020-08-191-243/+70
| | | | fixes and updated class Reference.
* Added plurals and context support to TranslationSkyJJ2020-08-191-83/+331
|
* Style: Remove unnecessary semicolons from `core`Rémi Verschelde2020-05-191-2/+2
| | | | | | | | | | Semicolons are not necessary after function definitions or control flow blocks, and having some code use them makes things inconsistent (and occasionally can mess up `clang-format`'s formatting). Removing them is tedious work though, I had to do this manually (regex + manual review) as I couldn't find a tool for that. All other code folders would need to get the same treatment.
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-8/+15
| | | | | Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
* Style: Enforce separation line between function definitionsRémi Verschelde2020-05-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-33/+0
| | | | | | | | | | | | | | Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
* Port member initialization from constructor to declaration (C++11)Rémi Verschelde2020-05-141-8/+1
| | | | | | | | | | Using `clang-tidy`'s `modernize-use-default-member-init` check and manual review of the changes, and some extra manual changes that `clang-tidy` failed to do. Also went manually through all of `core` to find occurrences that `clang-tidy` couldn't handle, especially all initializations done in a constructor without using initializer lists.
* Style: clang-format: Disable AllowShortIfStatementsOnASingleLineRémi Verschelde2020-05-101-1/+2
| | | | | | | Part of #33027, also discussed in #29848. Enforcing the use of brackets even on single line statements would be preferred, but `clang-format` doesn't have this functionality yet.
* Replace NULL with nullptrlupoDharkael2020-04-021-5/+5
|
* i18n: Add support for translating the class referenceRémi Verschelde2020-03-201-4/+13
| | | | | | | | | | | | | | - Parse `.po` files from `doc/translations/*.po` like already done with `editor/translations/*.po`. - Add logic to register a doc translation mapping in `TranslationServer` and `EditorSettings`. - Add `DTR()` to lookup the doc translation mapping (similar to `TTR()`). Strings are automatically dedented and stripped of whitespace to ensure that they would match the translation catalog. - Use `DTR()` to translate relevant strings in `EditorHelp`, `EditorInspector`, `CreateDialog`, `ConnectionsDialog`. - Small simplification to `TranslationLoaderPO`, the path argument was not really meaningful.
* Style: Set clang-format Standard to Cpp11Rémi Verschelde2020-03-171-3/+3
| | | | | | | | | | For us, it practically only changes the fact that `A<A<int>>` is now used instead of the C++03 compatible `A<A<int> >`. Note: clang-format 10+ changed the `Standard` arguments to fully specified `c++11`, `c++14`, etc. versions, but we can't use `c++17` now if we want to preserve compatibility with clang-format 8 and 9. `Cpp11` is still supported as deprecated alias for `Latest`.
* PoolVector is gone, replaced by VectorJuan Linietsky2020-02-181-9/+9
| | | | | Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector<Type>`.
* Remove duplicate ERR_PRINT macro.Marcel Admiraal2020-02-051-1/+1
|
* Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
* ResourceLoader: Add language code matching for localized resourcesRémi Verschelde2019-12-041-0/+3
| | | | | | | | Near matching was not implemented like in TranslationServer, so a resource remapped for 'ru' (but not 'ru_RU') would not be used as fallback if the system locale was 'ru_RU'. Fixes #34058.
* Translation: Refactor locale matching to use proper language codeRémi Verschelde2019-12-041-33/+55
| | | | | | | | | | | | | The previous code only parsed the first two characters (potentially reading out of bounds if input was invalid), but some locales use a 3-letter language code (e.g. 'nah_MX'). So I refactored the logic a bit to properly parse the locale and extract the part left of the regional code, if provided (supports both 'en_US' and 'en-US' style). I made TranslationServer::get_language_code() public as I'll use it in a follow up commit.
* Fix some crashes and using null pointersRafał Mikrut2019-10-281-0/+3
|
* Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in 'core/' and 'editor/'Braden Bodily2019-08-171-2/+1
| | | | | | | | | Condensed some if and ERR statements. Added dots to end of error messages Couldn't figure out EXPLAINC. These files gave me trouble: core/error_macros.h, core/io/file_access_buffered_fa.h (where is it?), core/os/memory.cpp, drivers/png/png_driver_common.cpp, drivers/xaudio2/audio_driver_xaudio2.cpp (where is it?)
* Translation: Fix logic bug finding match for regional localesRémi Verschelde2019-08-081-32/+32
| | | | | | | The match test was inverted. The rest of the changes are documentation and cleanup. Fixes #26346 and fixes #31192.
* Locales: Add some missing locale namesRémi Verschelde2019-05-021-2/+16
|
* Added TranslationServer::get_loaded_locales to return an array of all ↵Ken Paulson2019-04-241-0/+15
| | | | locales with a loaded Translation
* Add -Wshadow=local to warnings and fix reported issues.marxin2019-02-201-1/+1
| | | | Fixes #25316.
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Fallback to "en" when invalid locale is requestedRémi Verschelde2018-09-231-4/+7
| | | | Close #22365.
* Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-3/+3
| | | | | | This allows more consistency in the manner we include core headers, where previously there would be a mix of absolute, relative and include path-dependent includes.
* Make some debug prints verbose-only, remove othersRémi Verschelde2018-08-241-1/+0
|
* Removed unnecessary assignmentsWilson E. Alvarez2018-07-241-5/+3
|
* Add locale renames for Hebrew and Indonesian on WindowsRémi Verschelde2018-02-141-1/+18
| | | | | | | Windows does not fully respect ISO 639-1 like other systems, so we have to override its locale values for those languages. Also added comments to document the locale provenance.
* Bind many more properties to scriptsBojidar Marinov2018-01-121-1/+1
| | | | | | | Notable potentially breaking changes: - PROPERTY_USAGE_NOEDITOR is now PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_NETWORK, without PROPERTY_USAGE_INTERNAL - Some properties were renamed, and sometimes even shadowed by new ones - New getter methods (some virtual) were added
* Add missing copyright headers and fix formattingRémi Verschelde2018-01-051-0/+1
| | | | | | Using `misc/scripts/fix_headers.py` on all Godot files. Some missing header guards were added, and the header inclusion order was fixed in the Bullet module.
* Update copyright statements to 2018Rémi Verschelde2018-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Style: Apply new clang-format 5.0 style to all filesRémi Verschelde2017-12-071-5/+5
|
* i18n: Add support for Serbin (Cyrillic) localeRémi Verschelde2017-11-221-0/+2
| | | | [ci skip]
* Use UTF-8 for locale names. Fixes #12462.mhilbrunner2017-11-071-2/+2
|
* Add support for non-ISO locale identifiers via renames mapRémi Verschelde2017-10-301-63/+73
| | | | | | | Windows apparently uses "no" for Norwegian Bokmål, even though its ISO 639-1 language code is "nb"... Closes #12479. Also did some non-intrusive cleanup while at it.
* Add a function to get the full name of a localesheepandshepherd2017-10-251-0/+13
|
* Added the set/get_setting function in Editor/Project settings. Renamed has() ↵Juan Linietsky2017-10-051-1/+1
| | | | to has_setting. Fixes #11844
* Use HTTPS URL for Godot's website in the headersRémi Verschelde2017-08-271-1/+1
|
* Merge pull request #9987 from Rubonnek/move-members-to-initilization-listRémi Verschelde2017-08-111-7/+5
|\ | | | | Moved member variables from constructor to initialization list
| * Moved member variables from constructor to initialization listWilson E. Alvarez2017-08-081-7/+5
| |
* | Removes type information from method bindsIgnacio Etcheverry2017-08-101-2/+2
|/
* Style: Apply clang-format on all filesRémi Verschelde2017-07-301-1/+1
| | | | Thus fixing some invalid changes that had still made it to the master branch.
* -Renamed GlobalConfig to ProjectSettings, makes more sense.Juan Linietsky2017-07-191-4/+4
| | | | -Added system for feature overrides, it's pretty cool :)
* Reworked translation systemJuan Linietsky2017-06-281-0/+6
| | | | | -Label and Button reload translation on the fly -Resources are loaded and reload depending on locale
* Fix wrong fallback for localevolzhs2017-04-261-1/+1
|
* Add "Godot Engine contributors" copyright lineRémi Verschelde2017-04-081-0/+1
|
* A Whole New World (clang-format edition)Rémi Verschelde2017-03-051-863/+834
| | | | | | | | | | | | | | | | | | | | | | | | I can show you the code Pretty, with proper whitespace Tell me, coder, now when did You last write readable code? I can open your eyes Make you see your bad indent Force you to respect the style The core devs agreed upon A whole new world A new fantastic code format A de facto standard With some sugar Enforced with clang-format A whole new world A dazzling style we all dreamed of And when we read it through It's crystal clear That now we're in a whole new world of code
* -renamed globals.h to global_config.cpp (this seems to have caused a few ↵Juan Linietsky2017-02-211-1/+1
| | | | | | modified files) -.pck and .zip exporting redone, seems to be working..
* Rename the _MD macro to D_METHODHein-Pieter van Braam2017-02-131-15/+15
| | | | | | This new name also makes its purpose a little clearer This is a step towards fixing #56