campaignd: Detect .po files in add-ons and add them to the list of locales

(cherry-picked from commit 1db6fb393e)
This commit is contained in:
Iris Morelle 2018-06-24 04:51:57 -04:00
parent 8763e2f2b1
commit bf2d7d53e6
2 changed files with 10 additions and 0 deletions

View file

@ -42,6 +42,9 @@
### Miscellaneous and bug fixes
## Version 1.14.3+dev
### Add-ons server
* Made it so plain-text .po catalogues in add-ons are detected and added to
the list of translations for them.
### Campaigns
* Dead Water:
* In 'Tirigaz', take the situation into account of orcs being killed either

View file

@ -94,6 +94,13 @@ std::string format_addon_feedback_url(const std::string& format, const config& p
void find_translations(const config& base_dir, config& addon)
{
for(const config& file : base_dir.child_range("file")) {
const std::string& fn = file["name"].str();
if(filesystem::ends_with(fn, ".po")) {
addon.add_child("translation")["language"] = filesystem::base_name(fn, true);
}
}
for(const config &dir : base_dir.child_range("dir"))
{
if(dir["name"] == "LC_MESSAGES") {