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

untranslatable strings in the editor #3303

Open
2 of 4 tasks
sevu opened this issue Jul 2, 2018 · 10 comments
Open
2 of 4 tasks

untranslatable strings in the editor #3303

sevu opened this issue Jul 2, 2018 · 10 comments
Labels
Bug Issues involving unexpected behavior. Confirmed Issues that have been successfully reproduced by at least one developer. Editor Map/scenario editor issues. Good first issue Issues deemed adequate for contributors without prior experience to work on. Needs more info Issues deemed to contain insufficient information for reproducing or fixing. Translations Issues with translations, translation tooling, the translations engine, or code that uses it.

Comments

@sevu
Copy link
Member

sevu commented Jul 2, 2018

The ones I found:
untranslatable_2
the ones on the left are in English, the ones on thr Right are translated... Although, not in the recruit row

untranslatable_3
untranslatable_1
Maybe there are more such tooltips which I did not explore yet.


josteph edit:

  • The strings on the left in the first screenshot
  • The list of unit types after "Recruit"
  • Items
  • Stub Time of Day
@sevu sevu added Bug Issues involving unexpected behavior. Translations Issues with translations, translation tooling, the translations engine, or code that uses it. Editor Map/scenario editor issues. labels Jul 2, 2018
@Wedge009
Copy link
Member

I assume the translations are actually available in the German files. I can confirm the unit descriptions still being in English but I couldn't find the Items being stuck in English (using French translation). I also couldn't find the Stub Time of Day (I did use the time-of-day button near the mini-map).

@Wedge009 Wedge009 added the Confirmed Issues that have been successfully reproduced by at least one developer. label Aug 24, 2019
@Wedge009
Copy link
Member

The Identifier/Name/Type/etc labels appear to be marked for translation in https://github.com/wesnoth/wesnoth/blob/master/data/gui/window/editor_edit_scenario.cfg so something must be interfering with that.

@jostephd
Copy link
Member

9f08efe should fix the strings on the left being untranslated. To fix the recruit list being untranslated someone would have to convert unit_it->recruits() (in the lines being changed by that commit), which is a vector of type id's, to a vector of translated type names.

@jostephd jostephd added the Good first issue Issues deemed adequate for contributors without prior experience to work on. label Oct 16, 2019
jostephd added a commit that referenced this issue Oct 16, 2019
jostephd added a commit that referenced this issue Oct 16, 2019
jostephd added a commit that referenced this issue Oct 16, 2019
@Wedge009
Copy link
Member

Thanks, the first image is resolved now. What is N_ supposed to do anyway?

I couldn't confirm the Items or Stub things previously - requesting more details on these from @sevu, please.

@jostephd jostephd added the Needs more info Issues deemed to contain insufficient information for reproducing or fixing. label Oct 16, 2019
@jostephd
Copy link
Member

Thanks, the first image is resolved now. What is N_ supposed to do anyway?

N_("foo") is recognized by the gettext extractor and adds "foo" to the pot files, but as far as the compiler is concerned, it's equivalent to "foo", it doesn't have any runtime effect at all.

@jostephd
Copy link
Member

I can reproduce the Stub Time of Day by opening a scenario that doesn't have any [time] tags at all. (Create a new scenario, save it, exit wesnoth, edit the scenario cfg file outside wesnoth to delete the [time] tags, then open the scenario in the wesnoth editor.)

@CelticMinstrel
Copy link
Member

The purpose of N_ is for when the string will later be passed to the translation lookup... not entirely sure why that would be necessary, though.

@Wedge009
Copy link
Member

For 'Stub Time of Day' is it just a matter of changing the N_ to _?

, name(N_("Stub Time of Day"))

@jostephd
Copy link
Member

That depends. If you change N_ to _, the translation would be retrieved when that function (the constructor) is run. You'd need to check uses of that constructor. For example, suppose the stub time_of_day object is created once when Wesnoth starts. If that is the case, then if you start Wesnoth normally, change language, and start the editor, the wrong translation would be used. In that case, we'd need to keep the N_ but call _(foo.name) on the stub time_of_day object before it's displayed.

@CelticMinstrel
Copy link
Member

Except, don't use the _() syntax to call it in that case - _() should only be used for literal strings. Probably use the two-argument t_string constructor, or directly call one of the functions like translation::dsgettext.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues involving unexpected behavior. Confirmed Issues that have been successfully reproduced by at least one developer. Editor Map/scenario editor issues. Good first issue Issues deemed adequate for contributors without prior experience to work on. Needs more info Issues deemed to contain insufficient information for reproducing or fixing. Translations Issues with translations, translation tooling, the translations engine, or code that uses it.
Projects
None yet
Development

No branches or pull requests

4 participants