Commit Graph

19 Commits

Author SHA1 Message Date
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
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
Arular101
8a60918841 Update copyright notice year to 2018 2018-01-17 00:47:34 +01:00
abcdefg30
b329bf2642 Add more fail conditions to the spice harvesting missions 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
Jean-Rémy Buchs
fc725c6c0c add GPLv3+ header to all lua scripts 2017-04-10 21:13:51 +02:00
Paul Chote
d08a8eb1f6 Replace Map.Difficulty with Map.LobbyOption in scripts. 2016-06-19 22:15:27 +01:00
abcdefg30
82ff09acda Replace abused Map.ActorsInBox calls by Map.ActorsInWorld in all d2k missions 2016-04-08 17:48:06 +02:00
Pavel Penev
a23ea17c2d Update mission Lua scipts 2015-09-10 19:23:06 +01:00
abcdefg30
4f462fb988 Make use of tables for different difficulties 2015-06-15 17:39:32 +02:00
abcdefg30
4561a73240 Add the "Mentat" prefix to the messages in atreides01a 2015-06-05 15:00:34 +02:00
Matthias Mailänder
5a29e47f7c fix the Atreides color 2015-05-30 09:11:32 +02:00
abcdefg30
66b2c539a2 Added atreides-01a 2015-05-28 21:16:12 +02:00