-
-
Notifications
You must be signed in to change notification settings - Fork 85
FvwmPager: Allow translation of "Desk %d" label via Gettext #1216
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
Conversation
"Desk %d" label at the top of FvwmPager comes always in English, and can be easily localized in *.po (and then *.mo) translation file.
modules/FvwmPager/init_pager.c
Outdated
/* Initialize translations. */ | ||
FGettextInit("fvwm3", LOCALEDIR, "FvwmPager"); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't do this, we do not need to create a .pot file for FvwmPager that contains one string, instead add this to the .pot file for fvwm3. I have moved all the translations into a single file since they are overall quite small in fvwm.
FGettextInit("fvwm3", LOCALEDIR, "fvwm3");
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nobody is going to create a separate *.pot file. The name of this file is determined with the first argument domain
, which is "fvwm3" everywhere. The third argument module
is just used in log messages, hence all translated messages are collected to fvwm3.pot. All my translations to FvwmForm and FvwmPager are in fvwm3.po, and everything works OK, You can verify it yourself.
I have noticed that module
is also set to "fvwm3" in the existing code, but there is no point for this, we lose additional debug info. I would rather add different module
parameters for different Fvwm modules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, yea, I guess the second string is never actually used in any meaningful way. When I updated all the translation stuff I did away with separate translations per modules as it was way harder to maintain, and I just changed all the calls to what I suggested. Please just update it to be consistent with how I have it setup for other modules to use this wrapper. Though the actual string you send for the module name has no actual effect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then You might consider just removing the third parameter everywhere, because in this case it is meaningless anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, but at the time that I combined all the pot files, I just went with what is there. Problem with such an old project is there are lots of things like this, but they are working, so it really isn't that important.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have searched the code through, and FGModuleName
variable, which is set by module
parameter, is used only once, so no real profit, and it can be safely ignored (or removed, which is even better), so let it be "fvwm3".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then You might consider just removing the third parameter everywhere, because in this case it is meaningless anyway.
Nah, it can stay. I don't want to change it just for code-churn.
You should also be more complete on your pull requests, FvwmPager now outputs the 'Monitor RANDRNAME' string if configured, that should also be translated. I can't think of any other strings that might need translated off the top of my head, but you should add those too. Also this pr will need to follow the instructions to update the main fvwm3.pot file with any new strings. |
Could You point me to the place in the code where this string is output? I looked through the FvwmPager code and have found no more strings to translate. As far as I remember, "Monitor " is not output before the name, I checked it specifically (but I might be wrong).
It is updated because |
The function which is drawing the labels is |
I saw, I was just saying run |
It's a nice idea, I will look at this now. |
Ok, I will do it now. |
initialize_desks_and_monitors(); | ||
initialize_fonts(); | ||
initialize_desks_and_monitors(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because initialize_fonts()
contains localization and (since now) translation, and initialize_desks_and_monitors()
uses it to set desk label. I have checked that there is no other interference between these two functions.
@@ -31,6 +31,7 @@ | |||
#include <stdbool.h> | |||
|
|||
#include "libs/FShape.h" | |||
#include "libs/FGettext.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not strictly "missing" per-se, in that it comes via libfvwm3.a, but it's fine to explicitly include it here.
OK. |
"Desk %d" label at the top of FvwmPager comes always in English, and can be easily localized in *.po (and then *.mo) translation file.