-
-
Notifications
You must be signed in to change notification settings - Fork 993
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
days of the week not localized #1709
Comments
i cannot reproduce this one in 1.13.7 |
make a new save and wait two days |
Seems okay to me with French and 1.13.8+dev. Which language are you using? |
I do have this problem with 1.13.7 and 1.13.8+dev. |
wesnoth current uses boost::locale to translate these strings. boost::locale might use differnt beckend depending on how it it compiled. (you can for example compile boost with icu backend). the 1.13.7 release whch was using above seems to be using a winapi backend. if you start wesnoth with '--log-debug=general' it'll show you what backend it uses. |
it shows me this:
full log: https://pastebin.com/zQa69Y76 |
oh it might also depend on whther this code https://github.com/wesnoth/wesnoth/blob/1.13.8/src/gettext_boost.cpp#L440 decides to use std::put_time. You coudl try to replace that |
Setting it to 0 works |
I did some invetigating, and loonycyborg said the wesnoth build im using uses gcc 5.1 on which HAVE_PUT_TIME would be true, so there migth be something else involved that makes it not work with HAVE_PUT_TIME . |
I tried gcc 5.4, 6.3 and clang, can look if cmake makes a difference tomorrow. Did someone already try a linux build? |
The presence of the C locale in that log strikes me as weird. I'm not sure if it could be the cause though; I'd need to look around to see where all these log messages are generated. |
I had been using a utility to set dates on files and retesting today, I find some puzzling results: Windows build using MSVC 2017 and boost 1.64:
Linux build using scons and boost 1.62:
Both builds were recent (within last day or two) master revisions. For some reason, I cannot get the day of the week to show in the load game screen today, in either Windows or Linux. For Linux, I also get this in stderr: |
Is this still an issue? While testing I've noticed the date translated correctly in French on Windows with an MSVC 2017 build. |
I can see both day-of-week and month translated in my Windows build, but not in my Linux build (bf8c1b9). I have boost 1.66 in Windows, but still only 1.62 in Linux. I don't know if the differentiating factor is the OS, the boost version, or something else entirely. |
Do you have translations built for the Linux build? And if not, can you try after renaming your |
Yes, translations are built - Linux SCons script builds translations first. I can see everything else translated, but looking at the Load Game dialogue, the dates are still in English. I can't really rename my po directory to translations because there's already a translations directory present. The translations directory has the mo files. |
I wouldn't expect this issue to have anything to do with whether translations are built? The translated month and day names are more likely built into the date formatter somehow. |
Official Windows 1.14.7 release with boost 1.66:
Linux 1.14.8+dev with boost 1.67:
So it looks like the issue is still around... |
can someone test with wesnoth 1.15.1 on windows? |
Behaviour in 1.15.1+dev is the same for both Linux and Windows. I mean same as what I described above, not same as each other. |
and i assume replacing this line Line 520 in b6c311c
with an |
yes, this fixes it. |
Interesting. So Out of curiosity I set it to 0 (using boost instead of put_time) in Windows to see what happens and there seems to be no difference - the translations are correct as before. I also confirm using boost version in Linux behaves properly for non-English translations. put_time compiles okay but doesn't behave the same as boost's formatting, for some reason. So I wonder why put_time doesn't work as intended at the moment, and whether or not that's going to be an issue for 1.15 where it seems to be the only function call for strftime there. |
If it's dependent on boost vs std implementation, does that make it an upstream issue? Or still Wesnoth issue because Wesnoth code decides which implementation to use? (Are they even supposed to be equivalent functions?) Edit: Actually, since master uses only |
I don't know and if it fixes this issue I support changing it back to the boost version (unless it breaks something else) |
@sevu As original reporter, can you check the PRs when you have time, please? |
Regarding the day-month/month-day ordering. I'm guessing the internals of the put_time formatting is correctly handles locale-appropriate format for non-English languages since I see this displayed as day-month in French. But for English it is stuck as always being month-day ordering because of the coding: wesnoth/src/format_time_summary.cpp Line 65 in ae73e5c
put_time leaves it as it stands - en_US formatted - even if en_GB is selected. |
|
both PRs work |
@CelticMinstrel I wasn't aware these were configurable in translations! (I'm aware of the underscore notation but they don't usually register in my mind.) Thanks for the tip - I'll fix this for en_GB. @sevu Thanks for confirmation. Now it's just a question of what Vultraz wants to do with regards to boost vs std. |
Noting for the record that @jostephd could get |
For the record, I used |
We're using Boost for locales, aren't we? Could this be a bug in Boost? |
I'm not sure how it all works, but I noticed this comment which implies that our locale handling relies mostly on boost: Lines 232 to 234 in b1e8196
@jostephd I've also been trying to use the hard-coded |
@Wedge009 Locale names are platform-dependent. I don't know whether that string is a valid locale name on windows. On Linux, it's a valid locale name but locales have to be generated: see https://wiki.archlinux.org/index.php/Locale#Generating_locales (your distro may vary). You've mentioned testing in French, so |
I first checked what locale was being used before trying to force my own. On start-up it uses en_AU.UTF-8 (OS locale), then switches to fr_FR.UTF-8 as per Wesnoth preferences. It's the same on both Windows and Linux (at least according to the logs). |
Hmm, it's the same when I hard-code to |
@Wedge009 Can you try compiling and running this program?
For me, the program compiles and runs cleanly, but if I change the string to a locale name that's not printed by |
Ah, that's interesting. My When I tried using that hard-coded in Funnily enough my LANG variable is |
These two names are equivalent (they are aliases).
Odd, I see that too. The format string is |
When you want to load a saved game, there is on the right the date shown.
If it is a more or less recent save, then the date is shown with the weekday.
They aren't translated any more since 1.13.7.
I think @Vultraz has some more information about it.
Edit: same goes for months
The text was updated successfully, but these errors were encountered: