Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variables in campaign text are not translated #2833

Closed
golimarrrr opened this issue Apr 5, 2018 · 7 comments
Closed

Variables in campaign text are not translated #2833

golimarrrr opened this issue Apr 5, 2018 · 7 comments
Assignees
Labels
Translations Issues with translations, translation tooling, the translations engine, or code that uses it.
Milestone

Comments

@golimarrrr
Copy link

I'm playing Legend of Wesmere and the texts are translated to Spanish, however at times I found the English word "and". After checking the .po file I see that it came from variables like $left_behind_kalenz or $left_behind_landar
Is there a way to translate also the text inside variables?

@GregoryLundberg GregoryLundberg added the Translations Issues with translations, translation tooling, the translations engine, or code that uses it. label Apr 5, 2018
@GregoryLundberg GregoryLundberg added this to the 1.14.0 milestone Apr 5, 2018
@GregoryLundberg
Copy link
Contributor

I found

value= _ "$left_behind_{NAME} and $l3_store_{NAME}[$i].name" # wmllint: ignore

which is a translatable string. Most likely it simply was not translated.

I'm assigning this to @ivanovic for final disposition.

@soliton-
Copy link
Member

soliton- commented Apr 5, 2018

The {NAME} part looks like a macro argument in the string there. That's not going to work.

@stevecotton
Copy link
Contributor

Aside from the {NAME} macro, there's also character names going in to the string, the so desired result is something like "Amabrisal, Caewiith, Lasal and Fanemanar".

What it needs is an i18n version of the [set_variable][join] method, which localises not only the commas and the word "and", but also changes it to match the target languages' grammar rules. So if some language's grammar looks like "Amabrisal and Caewiith, Lasal, Fanemanar" then the function would do that. Maybe I'm searching for the wrong keywords, but I can't find any online discussion of an i18n join function.

For 1.14, I think there's an option to change it to "Amabrisal, Caewiith, Lasal, Fanemanar" in all languages. That means the English grammar isn't quite right, and the non-English grammar probably isn't quite right, but you don't get an English word in the middle of a non-English sentence.

@Vultraz
Copy link
Member

Vultraz commented Apr 5, 2018

Assigning @shikadiqueen since she's been dealing with localization stuff. Ivanovic isn't active anymore besides committing translations.

@Vultraz Vultraz assigned irydacea and unassigned ivanovic Apr 5, 2018
@CelticMinstrel
Copy link
Member

We have an API function that does exactly what's needed here, but I think it probably can't be implemented in a string-freeze-safe way. Then again, most of the other suggestions also aren't string-freeze-safe?

For the record, the requisite function is wesnoth.format_conjunct_list in Lua (and of course is available in C++ too).

@irydacea
Copy link
Member

irydacea commented Apr 6, 2018

It seems like these are the only two cases in mainline:

./campaigns/Legend_of_Wesmere/scenarios/chapter3/09_Bounty_Hunters.cfg:                                value= _ "$left_behind_{NAME} and $l3_store_{NAME}[$i].name" # wmllint: ignore
./campaigns/Legend_of_Wesmere/scenarios/chapter3/09_Bounty_Hunters.cfg:                                value= _ "$left_behind_{NAME}|, $l3_store_{NAME}[$i].name" # wmllint: ignore

They definitely can't be fixed during a string freeze, but the patches can be merged after 1.14.0 is tagged and announced.

@CelticMinstrel
Copy link
Member

CelticMinstrel commented Apr 6, 2018

I believe that commit (which is PR #2834) should fix this issue, provided I didn't make a trivial syntax error.

@Vultraz Vultraz closed this as completed Apr 12, 2018
jostephd pushed a commit to jostephd/wesnoth that referenced this issue Oct 18, 2018
jostephd pushed a commit to jostephd/wesnoth that referenced this issue Oct 27, 2018
jostephd pushed a commit to jostephd/wesnoth that referenced this issue Oct 27, 2018
jostephd pushed a commit to jostephd/wesnoth that referenced this issue Oct 28, 2018
jostephd added a commit that referenced this issue Oct 30, 2018
* josteph/forward-port-some-of-the-174:
  don't call invalidate_layout() unless needed
  Convert a bunch more C-style casts I missed in 0dc5656 to static_cast
  fixup  don't show travis notifications from forks (cherry picked from commit 55bc62f)
  don't show travis notifications from forks (cherry picked from commit d6ab780)
  fix out of bonunds check
  Lua: Invalidate layout in set_dialog_value()
  Fix includes
  Implement iOS version detection
  Game Load: Use child_or_empty().
  Themes: Fix the observers icon being hidden under the minimap
  Game Load: Restore the ability to select 1.12.6 savegames in the list
  Fix CMake build on macOS
  NR S8: compatibility commit to make the new companions from scratch if we don't have them stored
  Partially revert "Additional village variations (#3342)"
  DM: Add last breath dialog for Zorlan
  DM: Generalize death message so it works when Delfador is young and old
  gui2/unit_recall: Change Recall button back to its correct label
  Updated changelog in Xcode
  Add WML unit test for unupgradable (#3336)
  gui2/unit_recall: Fix i18n issues
  DM: add some TODOs
  iOS: finger scrolling in controls.
  iOS document directories. Might use these on other platforms as well.
  .gitignore for CLion
  German multiplayer translation: fixes
  German translation: reword era descriptions
  German translation: fix a string
  Statistics Dialog: merge unit name and count labels
  add / remove some comments
  Tutorial Part2: Give the player a canche to undo his move
  UtBS 5: changes to scenario locations (#3104)
  Update changelog in macOS package
  SotA: transform bats already after the 5th scenario
  TRoW: revert workaround for #2912
  Changelog entry for the #2912 work around
  TRoW: Increase Rithrandil's workaround portrait height to 700
  TRoW: IPF-downscale Rithrandil's portrait, as a workaround to #2912
  Add missing deprecation messages for deprecated macros
  Northern Rebirth S02_01: keep side 8 leader from wandering off too far
  changelog: remove AToTB AI entry
  wesnothd: prevent another instance of crash from owner not in player_connections
  Increased in-game chat size. This makes it render more smoothly
  Minor tweaks to classic theme (thanks enclave for doing this)
  Update RELEASE_NOTES (cherry picked from commit e2a2a85)
  Update changelog for custom AI for AToTB S2
  TRoW: revert changes, to avoid a potential OOS
  Re-apply patches to fix issues #2844 and #2846 in SotA
  Clear RELEASE_NOTES
  Repair 66ab35f in the upwards direction
  Add changelog for 1.14.0
  add placeholer links to appdata file
  Hide Editor help section
  UtBS: readd do_not_list
  UtBS: wmlindent pass
  Fix MP label for #2855
  Fixup 601c67d
  UtBS: Re-added compatibility code to load old saves using the new elves
  Swap count and name columns in statistics (fixes #2893)
  Revert string changes in SotA for 1.14 RC 3 - gold
  AI recruitment: use unit-specific recall cost
  AI recruitment: fix units on recall list interfering with recruiting
  Fixup f7ab008 before GCC complains about an unused parameter >_<
  Help: disabled parsing error popup
  LoW: Fix translation error in conjunct list (fixes #2833) (#2834)
  Fix pofix
  Changelog entry for recent SotA fixes
  Pofix entry for fc6c3ac
  Pofix entry for b86a296
  Pofix entry for ab9f29a
  Fix HP label in longer languages
  Help: removed sort_sections key with invalid value
  less redraw_everything calls when receiving [change_controller]
  fix gui2 dialog disappearing after [change_controller]
  Use a fallback for when the player name is not known in debug notifications
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Translations Issues with translations, translation tooling, the translations engine, or code that uses it.
Projects
None yet
Development

No branches or pull requests

8 participants