summaryrefslogtreecommitdiff
path: root/core/translation.cpp
AgeCommit message (Collapse)Author
2020-05-19Style: Remove unnecessary semicolons from `core`Rémi Verschelde
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.
2020-05-14Style: Enforce braces around if blocks and loopsRémi Verschelde
Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
2020-05-14Style: Enforce separation line between function definitionsRémi Verschelde
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.
2020-05-14Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde
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.
2020-05-14Port member initialization from constructor to declaration (C++11)Rémi Verschelde
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.
2020-05-10Style: clang-format: Disable AllowShortIfStatementsOnASingleLineRémi Verschelde
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.
2020-04-02Replace NULL with nullptrlupoDharkael
2020-03-20i18n: Add support for translating the class referenceRémi Verschelde
- 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.
2020-03-17Style: Set clang-format Standard to Cpp11Rémi Verschelde
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`.
2020-02-18PoolVector is gone, replaced by VectorJuan Linietsky
Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector<Type>`.
2020-02-05Remove duplicate ERR_PRINT macro.Marcel Admiraal
2020-01-01Update copyright statements to 2020Rémi Verschelde
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.
2019-12-04ResourceLoader: Add language code matching for localized resourcesRémi Verschelde
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.
2019-12-04Translation: Refactor locale matching to use proper language codeRémi Verschelde
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.
2019-10-28Fix some crashes and using null pointersRafał Mikrut
2019-08-17Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in 'core/' and 'editor/'Braden Bodily
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?)
2019-08-08Translation: Fix logic bug finding match for regional localesRémi Verschelde
The match test was inverted. The rest of the changes are documentation and cleanup. Fixes #26346 and fixes #31192.
2019-05-02Locales: Add some missing locale namesRémi Verschelde
2019-04-24Added TranslationServer::get_loaded_locales to return an array of all ↵Ken Paulson
locales with a loaded Translation
2019-02-20Add -Wshadow=local to warnings and fix reported issues.marxin
Fixes #25316.
2019-01-01Update copyright statements to 2019Rémi Verschelde
Happy new year to the wonderful Godot community!
2018-09-23Fallback to "en" when invalid locale is requestedRémi Verschelde
Close #22365.
2018-09-12Make core/ includes absolute, remove subfolders from include pathRémi Verschelde
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.
2018-08-24Make some debug prints verbose-only, remove othersRémi Verschelde
2018-07-24Removed unnecessary assignmentsWilson E. Alvarez
2018-02-14Add locale renames for Hebrew and Indonesian on WindowsRémi Verschelde
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.
2018-01-12Bind many more properties to scriptsBojidar Marinov
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
2018-01-05Add missing copyright headers and fix formattingRémi Verschelde
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.
2018-01-01Update copyright statements to 2018Rémi Verschelde
Happy new year to the wonderful Godot community!
2017-12-07Style: Apply new clang-format 5.0 style to all filesRémi Verschelde
2017-11-22i18n: Add support for Serbin (Cyrillic) localeRémi Verschelde
[ci skip]
2017-11-07Use UTF-8 for locale names. Fixes #12462.mhilbrunner
2017-10-30Add support for non-ISO locale identifiers via renames mapRémi Verschelde
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.
2017-10-25Add a function to get the full name of a localesheepandshepherd
2017-10-05Added the set/get_setting function in Editor/Project settings. Renamed has() ↵Juan Linietsky
to has_setting. Fixes #11844
2017-08-27Use HTTPS URL for Godot's website in the headersRémi Verschelde
2017-08-11Merge pull request #9987 from Rubonnek/move-members-to-initilization-listRémi Verschelde
Moved member variables from constructor to initialization list
2017-08-10Removes type information from method bindsIgnacio Etcheverry
2017-08-08Moved member variables from constructor to initialization listWilson E. Alvarez
2017-07-30Style: Apply clang-format on all filesRémi Verschelde
Thus fixing some invalid changes that had still made it to the master branch.
2017-07-19-Renamed GlobalConfig to ProjectSettings, makes more sense.Juan Linietsky
-Added system for feature overrides, it's pretty cool :)
2017-06-28Reworked translation systemJuan Linietsky
-Label and Button reload translation on the fly -Resources are loaded and reload depending on locale
2017-04-26Fix wrong fallback for localevolzhs
2017-04-08Add "Godot Engine contributors" copyright lineRémi Verschelde
2017-03-05A Whole New World (clang-format edition)Rémi Verschelde
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
2017-02-21-renamed globals.h to global_config.cpp (this seems to have caused a few ↵Juan Linietsky
modified files) -.pck and .zip exporting redone, seems to be working..
2017-02-13Rename the _MD macro to D_METHODHein-Pieter van Braam
This new name also makes its purpose a little clearer This is a step towards fixing #56
2017-02-13Remove use of _SCS from ADD_METHODHein-Pieter van Braam
This saves typing and is a step towards fixing #56
2017-02-08Added "Scots" locale name, fixing #7630Nuno Donato
2017-02-01CSV translation import pluginJuan Linietsky