Browse Source

Ability to add comments for GRASS translators with GTC keyword in code comments

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@53888 15284696-431f-4ddb-bdfa-cd5b030d7da7
Maris Nartiss 12 years ago
parent
commit
1287ca3fa7
3 changed files with 19 additions and 4 deletions
  1. 8 0
      SUBMITTING
  2. 3 3
      locale/Makefile
  3. 8 1
      locale/README

+ 8 - 0
SUBMITTING

@@ -142,6 +142,14 @@ following rules:
     Always use the gettext macros with _("") for user messages,
     example:
       G_fatal_error(_("Vector map <%s> not found"), name); 
+    It is suggested to add a comment line before translatable user message
+    to give a hint to translators about meaning or use of 
+    cumbersome or obscure message. First word in the comment must be GTC
+    - GRASS translation comment,
+    example:
+        /* GTC A name of a projection */
+        G_message(_("State Plane"));
+    See locale/README for details.
 
 
     Pipe/file data output:

+ 3 - 3
locale/Makefile

@@ -47,11 +47,11 @@ pot:
 		exit 1 ; \
 	fi
 	@echo "Generating $(LIBDOMAIN)..."
-	xgettext -k_ -o ./templates/$(LIBDOMAIN).pot `$(LIB_POTFILES)`
+	xgettext -k_ -cGTC -o ./templates/$(LIBDOMAIN).pot `$(LIB_POTFILES)`
 	@echo "Generating $(MODDOMAIN)..."
-	xgettext -k_ -o ./templates/$(MODDOMAIN).pot `$(MOD_POTFILES)`
+	xgettext -k_ -cGTC -o ./templates/$(MODDOMAIN).pot `$(MOD_POTFILES)`
 	@echo "Generating $(WXPYDOMAIN)..."
-	xgettext -k_ -o ./templates/$(WXPYDOMAIN).pot `$(WXPY_POTFILES)` 
+	xgettext -k_ -cGTC -o ./templates/$(WXPYDOMAIN).pot `$(WXPY_POTFILES)` 
 
 #merge already existing translations with new messages in POT template file and create new po files:
 update-po:

+ 8 - 1
locale/README

@@ -48,12 +48,19 @@ NOTE: Also G_warning() and G_fatal_error() need the message
 NOTE2: Also the parameters/flags of each module needs the
        macro _().
 
+NOTE3: Notices to translators can be added by placing
+       a comment line starting with GTC tag just above
+       message to be translated:
+        /* GTC A comma separated keyword list. 
+           Should not contain spaces! */
+        keywords = _("first,second,third");
+        
 All these messages strings will be then automatically 
 extracted into the message files.
 
 See for example ./vector/v.what.rast/main.c
 
-NOTE3: Such lines
+NOTE4: Such lines
         fprintf (stdout,"\n");
   do not need a change as no translation is needed.