-
Notifications
You must be signed in to change notification settings - Fork 64
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
add support for translations using gettext #121
Conversation
These are the main changes I made to prepare for adding gettext support. Other files will follow, most of them auto-generated after running `autoreconf -ivf` and `gettextize` See https://www.gnu.org/software/gettext/manual/html_node/gettextize-Invocation.html#gettextize-Invocation https://www.gnu.org/software/gettext/manual/html_node/po_002fPOTFILES_002ein.html#po_002fPOTFILES_002ein and sections 4.2 - 4.4 https://www.gnu.org/software/gettext/manual/html_node/Triggering.html#Triggering
po template file. This is updated automatically and shouldn't be edited.
This should have been included in an earlier commit, but you'll get the idea xD
Any time a new language is added, you add it to the LINGUAS file. Here's an example: https://github.com/theimpossibleastronaut/rmw/blob/master/po/LINGUAS
Marked some more strings. Regenerated bric.pot (`cd po && make update-po`)
@@ -1579,7 +1582,7 @@ int handle_tag_movement(int where) { | |||
strcpy(orig_filename, Editor.filename); | |||
if(where == MOVE_BACK) { | |||
if(isempty(&tag_stack)) { | |||
editor_set_status_message("at bottom of tag stack"); | |||
editor_set_status_message(_("at bottom of tag stack")); |
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.
This string my be ambiguous to translators. https://www.gnu.org/software/gettext/manual/html_node/Preparing-Strings.html#Preparing-Strings
I assume "you are" is implied, but in some languages, grammar changes depending on the subject, so I suggest leaving a TRANSLATOR note here or adjusting the string.
} | ||
if(key[0] == '\0') { | ||
editor_set_status_message("No identifier under cursor"); | ||
editor_set_status_message(_("No identifier under cursor")); |
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.
"identifier" may be ambiguous. I suggest leaving a TRANSLATOR note describing what an identifier specifically refers to.
@@ -1461,7 +1463,8 @@ void editor_goto(int linenumber) | |||
editor_refresh_screen(); | |||
return; | |||
} else { | |||
editor_set_status_message("Out of bounds"); | |||
/* TRANSLATORS: alternate meaning: "exceeds boundary" */ |
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.
This is an example of a TRANSLATOR note. You can see in the .pot file that these notes are added to the template, so translators will see them as they are translating po files.
@@ -2192,7 +2200,7 @@ int main(int argc, char **argv) | |||
if(!is_file_locked(CurrentFile)){ | |||
lock_file(CurrentFile); | |||
}else{ | |||
fprintf(stderr, "The file has been locked, try to remove the locker!\n"); |
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.
"locker" will likely be ambiguous to translators. I suggest adjusting the string or leaving a TRANSLATOR note with a specific description of what locker refers to.
The extra space means they are an exact match, which means the redundant string in the pot file will be removed.
Also, the 4 lines removed in Makefile.am aren't needed after adding this to configure.ac
To test, I translated one line in Dutch, and it works. :) ``` andy@oceanus:~/src/bric/install_test/bin$ LANG=nl_NL.utf8 ./bric Gebruik: bric <bestandsnaam> ``` This not only requires the translation in bric, but for the user to have the locale installed on his system, if I'm not mistaken. I already had the This locale installed. to install on Debian Linux https://wiki.debian.org/Locale#Manually
|
||
#: src/bric.c:2186 | ||
#, c-format | ||
msgid "Usage: bric <filename>\n" |
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.
@sexybiggetje this is what I translated to test initial support for internationalization.
And yes, you know I'll be asking you to translate this whole file after this PR is merged. xD
Please find the attached zip file. Github doesn't allow the po file directly.
|
Thanks for another translation, @sexybiggetje ! I think it would be good to submit your po file as a PR after this is merged. s for the suggestions about the strings in the source, they sound pretty reasonable to me. We'll take a look at that in the near future. |
I've separated some of my tasks under separate commits, so if you view them individually, you'll understand the changes a little better.
You can see some hints I've added in my commit messages.