Commit Graph

16 Commits

Author SHA1 Message Date
Paul Chote
8452f71481 Rename Lua UserInterface.Translate to .GetFluentMessage. 2024-11-03 16:52:47 +02:00
RoosterDragon
0bfa53b58d Teach CheckTranslationReference about translations in Lua scripts
Using the glory of regex, we can scrape any Lua script files that a map includes and locate calls to the UserInterface.Translate method. We can then treat them in the same way as C# fields marked with a TranslationReferenceAttribute. This allows the lint check to validate the translation invoked in the .lua script has a matching entry in the translation .ftl files, with all the required arguments (if any).

We can also locate any calls to AddPrimaryObjective or AddSecondaryObjective defined by the utils.lua script, which also accept translation keys.

The are a couple of restrictions:
- When linting the map, we don't check for keys in the ftl file that are unused. This is because the linter doesn't load all the keys when checking maps.
- In order to validate translation arguments with the regex, we require the Lua script to pass the table of arguments inline at the callsite. If it does not, we raise a warning so the user can adjust the code.
2024-07-22 17:27:58 +02:00
JovialFeline
adf515d50b Fix D2k objectives, alerts in Ha2, Or4, At5 2023-12-15 12:36:05 +02:00
Matthias Mailänder
378f66a1ff Resolve Lua language server diagnosed problems. 2023-03-28 11:45:15 +02:00
Matthias Mailänder
5032b2b872 Extract translation strings. 2023-02-19 23:46:41 +01:00
abcdefg30
5bf7fe852c Remove the copyright year numbers 2023-01-11 11:58:54 +02:00
abcdefg30
6a31b1f9f3 Update the copyright header year 2022-05-28 00:35:10 -05:00
Andre Mohren
6810469634 Updated copyright years. 2021-06-29 18:33:21 -05:00
abcdefg30
23b3c237b7 Update the year numbers in all license headers to 2020 2020-01-05 17:00:34 +00:00
abcdefg30
8b9603168a Change the year number in all lua headers from 2018 to 2019 2019-01-26 23:15:21 +01:00
abcdefg30
dfd60655af Fix a crash in atreides05
We removed ExternalCondition from starport
2018-04-12 17:01:59 +02:00
Arular101
8a60918841 Update copyright notice year to 2018 2018-01-17 00:47:34 +01:00
abcdefg30
02c371f68a Fix a bogus condition 2017-08-17 19:05:38 +02:00
abcdefg30
6907929cb4 Fix the harvest protection logic 2017-08-17 19:05:38 +02:00
abcdefg30
a942ca8f57 Add a global script for campaign missions in d2k 2017-08-17 19:05:38 +02:00
abcdefg30
96e2b4fe70 Add atreides-05 2017-04-04 23:23:44 +02:00