See https://github.com/geany/geany-plugins/pull/769. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/1941
-- Commit Summary --
* HACKING: added section "Translation"
-- File Changes --
M HACKING (16)
-- Patch Links --
https://github.com/geany/geany/pull/1941.patch https://github.com/geany/geany/pull/1941.diff
b4n requested changes on this pull request.
@@ -341,6 +341,22 @@ Example::
{ ...
+Translation +^^^^^^^^^^^ + +Strings which are visible to geany users need to be translated and thus +should be enclosed in ``_( )`` to have them being recognized by the GNU +translation tools. Also spaces right after the first ``"`` of a string +shall not be used as they will be cut of by the tools. This is a bad example::
No they won't be cut off. If you're referring to my erroneous comment on @Skif-off's PR recently, it was just me reading the diff the wrong way around and thinking he was removing the space instead of adding it. GNU GetText properly handle any C string, so where to place the space is not a concern for it to appear, it's a mere code style thing.
@@ -341,6 +341,22 @@ Example::
{ ...
+Translation +^^^^^^^^^^^ + +Strings which are visible to geany users need to be translated and thus +should be enclosed in ``_( )`` to have them being recognized by the GNU +translation tools. Also spaces right after the first ``"`` of a string
`_()` is actually a function call, where `_` is an alias for `gettext`. But yes, it's also used to recognize strings that need translating by the tools that read the source code for extracting strings for that purpose. But the formulation you chose is not perfect, it's not only for recognizing the string, but also to actually translate it for the program. `gettext()` (for which `_` is an alias) is returning the translated version of the passed-in string.
@@ -341,6 +341,22 @@ Example::
{ ...
+Translation +^^^^^^^^^^^ + +Strings which are visible to geany users need to be translated and thus +should be enclosed in ``_( )`` to have them being recognized by the GNU +translation tools. Also spaces right after the first ``"`` of a string +shall not be used as they will be cut of by the tools. This is a bad example:: + + label = gtk_label_new (_("First sentence of a bad case example."
No space between the function name and the open parenthesis in Geany code style.
@@ -341,6 +341,22 @@ Example::
{ ...
+Translation +^^^^^^^^^^^ + +Strings which are visible to geany users need to be translated and thus
You should probably drop `geany` here (or at least capitalize it ;)).
If you're referring to my erroneous comment on @Skif-off's PR recently, it was just me reading the diff the wrong way around and thinking he was removing the space instead of adding it.
Yes, I am referring to it. I thought there was a little pitfall but it isn't as you explained. I changed the text according to your review. But I would also be fine with closing the PR if you think it's to trivial.
github-comments@lists.geany.org