Skip to content

Commit

Permalink
campaignd: Detect .po files in add-ons and add them to the list of lo…
Browse files Browse the repository at this point in the history
…cales
  • Loading branch information
irydacea committed Jun 24, 2018
1 parent 583b0f1 commit 1db6fb3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Expand Up @@ -42,6 +42,9 @@
* [remove_sound_source] now accepts a comma-separated ID list

## 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
Expand Down
7 changes: 7 additions & 0 deletions src/campaign_server/addon_utils.cpp
Expand Up @@ -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") {
Expand Down

0 comments on commit 1db6fb3

Please sign in to comment.