[Github-comments] [geany/geany] HACKING: added section "Translation" (#1941)

Colomban Wendling notifications at xxxxx
Sat Sep 1 21:56:54 UTC 2018


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 ;)).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1941#pullrequestreview-151604211
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20180901/e118cdde/attachment.html>


More information about the Github-comments mailing list