Up to now the references (lines starting with `#:`) in the portable
object templates generated by `updateTemplates.py` didn't comply with
the PO file format specification. They violated the specification in two
ways:
- White spaces in file names got replaced by non-breaking spaces
(U+00A0), instead of the file names being enclosed by First Strong
Isolate (U+2068) and Pop Directional Isolate (U+2069)
- the references didn't just include the filename and optionally the
line number of the string, as defined in the specification, but also a
non-standard "breadcrumb" component, which made them unnecessary
hard to read in certain cases and difficult to use with tools
expecting properly formatted references
This commit fixes both of these issues by properly encoding white
spaces and removing the breadcrumb component.
Patch by: @Dunedan
Accepted by: @Stan
Differential Revision: https://code.wildfiregames.com/D5309
This was SVN commit r28159.
Up to now the languages and their names shown in the credits came from a
static mapping in `creditTranslators.py`. The language names noted in
there weren't consistent: some where present just in English, some in
their native language and some in both. This also required adjusting the
mapping manually, whenever a new language got added on Transifex,
otherwise its translators wouldn't be credited properly.
This commit resolves both issues, by making the language names
translatable and removing the need for the static mapping in
`creditTranslators.py`.
There is one minor nuisance with this implementation: As the languages
get listed in the credits in the same order as in `translators.json` and
they are ordered by there English name in there, the order might not be
alphabetical in other languages.
Running `creditTranslators.py` for the first time with these changes
will produce a rather large diff for `translators.json`, as not just the
language names will be changed to the English name of the language in
many cases, but the order of languages in the file as well. The first
run of `updateTemplates.py` after that will then add the languages as
new translatable strings.
Patch by: @Dunedan
Accepted by: @Itms
Differential Revision: https://code.wildfiregames.com/D5300
This was SVN commit r28158.
Extracting translatable strings source files did also extract strings
which only consisted of spaces and line breaks. As that doesn't make
much sense, added noise in the portable object templates, for
translators and when linting the translations, this commit omits such
strings when generating the portable object templates.
Patch by: @Dunedan
Accepted by: @Stan, @Itms
Differential Revision: https://code.wildfiregames.com/D5308
This was SVN commit r28157.
While `creditTranslators.py` did already contain logic to remove
duplicate translator names, that logic didn't remove translator names
which only differed in their casing. As the removal was implemented
using an (unordered) `set`, the order of such duplicate names wasn't
deterministic and oscilated between the possible orders with different
invocations of `creditTranslators.py`, creating unnecessary changes to
`translators.json`.
This commit fixes that so that duplicate names are also removed when
they just differ in their casing and prefers the variant with has the
names starting with a capitalized letter.
Patch by: @Dunedan
Accepted by: @Stan
Differential Revision: https://code.wildfiregames.com/D5304
This was SVN commit r28152.
Up to now the "debug" and "long" translations got generated without the
comments present in the portable object files. This lead to the problem
that "dennis-ignore" directives in the comments weren't present in these
translations anymore, causing dennis to report false-positives for the
debug translations. This commit fixes that by keeping the comments in
the debug translations.
Patch by: @Dunedan
Accepted by: @Stan
Differential Revision: https://code.wildfiregames.com/D5303
This was SVN commit r28150.
When calling `Engine.PushGuiPage` a promise is returned. The promise is
settled when the "child" page is closed. That allows to `await` it
inside `async` functions.
Previously the callback was run right inside the call to
`Engine.PopGuiPage`. Now the continuation of the promise is called at
the end of the "tick".
This won't help performance. It will more likely make things worse.
Since gui pages aren't opened or closed that frequently, it doesn't
matter that much.
Refs: 86c151ebaa
For the engine side:
The promise is stored in the `CGUIManager::SGUIPage` (like previously
the callback). When the promise is fulfilled it enqueues a callback in
the `JobQueue` of the `JSContext`.
Original patch by: @wraitii
Comments by: @wraitii, @Stan, @Polakrity, @lyv, @elexis, @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D3807
This was SVN commit r28145.
The changes from D5290 broke the script to credit translators, as the
lines with the translators might now include additional information,
like the years of contribution, after the usernames, that would've
been included by `creditTranslators.py` as well.
This commit also slighly hardens the removal of deleted users to from
the credited translators to reduce the likelihood to remove still
existing users.
Patch by: @Dunedan
Accepted by: @Stan
Differential Revision: https://code.wildfiregames.com/D5298
This was SVN commit r28142.
Use the same `CLogger` constructor.
Never take ownership of the streams.
Comments by: @Stan
Differential Revision: https://code.wildfiregames.com/D5203
This was SVN commit r28140.
`std::shared_ptr` is intrusive. When a function expects a
`std::shared_ptr` the caller has to use it too and can't store the
element on the stack for example.
Comments by: @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D5221
This was SVN commit r28131.
The regex for removing the email address of the last translator from
PO-files contained two bugs causing it not to match:
1. It didn't account for text after the email address and PO-files
from Transifex contain the year of the last translation there.
2. It expected a second `\\n"` at the end of the line, instead of `\n"`.
This commit fixes both of these issues and simplifies the regexes. It
also ensures that the text after the email address is kept as well.
Patch by: @Dunedan
Accepted by: @Stan
Differential Revision: https://code.wildfiregames.com/D5290
This was SVN commit r28130.
Summary:
Most of the times the callback stores a reference to a variable in scope
where the `Future` is in. When the scope is left the reference get's
dangling. `CancelOrWait` is called in multiple places (mostly
destructors) to ensure the callback isn't executed anymore.
This patch deduplicates thous calls to `CancelOrWait`.
Refs: #5874
Comments by: @Stan, @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D5208
This was SVN commit r28128.
As we depend on Babel for i18n tooling nowadays, we can also use its
maintained JavaScript-lexer, instead of the one forked from an old
version of Babel.
Doing so reduces the amount of code we have to maintain, adds new
functionality (like properly handling hexadecimal unicode notations) and
fixes some regex related incompatibilities which makes generating
portable object templates possible with recent Python versions.
The use of `tokenize(…, dotted=False)` is necessary, as we use this
lexer for C++ code as well and detection of most strings in C++ code
fails otherwise. As dotted names weren't supported by version of the
lexer we used until now, this isn't a regression.
Patch by: @Dunedan
Accepted by: @Stan
Differential Revision: https://code.wildfiregames.com/D5293
This was SVN commit r28124.
When the `RL::Interface` is destroied but the engine isn't completely
shoutdown there was a dangling pointer. The time the dangling pointer is
accessable got expanded with 968e55704a.
Whith this patch there no dangling pointer (in that regard).
Accepted by: @vladislavbelov
Comments by: @Stan, @sera
Trac Tickets: #5989
Differential Revision: https://code.wildfiregames.com/D5254
This was SVN commit r28123.
This way it's clear what's the input and what's the output of the
computation.
All map generation scripts should reman working. They are adopted in a
future commit.
`Engine.SetProgress` and `Engine.ExportMap` can be removed in a future
commit.
Comments by: @marder, @sera, @Stan
Differential Revision: https://code.wildfiregames.com/D5220
This was SVN commit r28093.
The user doesn't have to fiddle with `std::shared_ptr`.
And two (more unrelated) things: use `std::unordered_map`, use a
`std::find_if` in the callback.
Comments By: @vladislavbelov, @Stan
Differential Revision: https://code.wildfiregames.com/D5239
This was SVN commit r28048.
Since 1bccfef6fb the `CSimulation2` uses the `std::shared_ptr` only in
the constructor and stores a `ScriptContext&` (inside it's members).
That's a bit dangerous: A caller might think `CSimulation2` takes
ownership of the `ScriptContext`.
With this commit the caller has to pass an `ScriptContext&` to the
constructor.
Comments By: @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D5223
This was SVN commit r28046.
The `StateSet` is only used to check if a state is valid. That's useless
since it wouldn't be found in the `TransitionMap` - With the same
outcome.
Accepted By: @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D5236
This was SVN commit r28039.
libxml2 v2.12.1 includes less header indirectly. Also `xmlError*` has to
be changed to `const xmlError*`.
Original Patch By: Riesi
Accepted By: @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D5219
This was SVN commit r27980.
The Function is not restricted to std::function anymore. Move only
function become possible.
Differential Revision: https://code.wildfiregames.com/D4840
This was SVN commit r27962.
This fixes an issue revealed by 7350b9042e that affected deserialized
games.
Adding tests further highlighted a bug in the calculations, which is
fixed.
Reviewed By: phosit
Fixes#6883
Differential Revision: https://code.wildfiregames.com/D5181
This was SVN commit r27928.