KDE/kdesdk/scripts

Nicolas Goutte nicolasg at snafu.de
Mon Aug 14 17:54:00 BST 2006


SVN commit 573048 by goutte:

A translatable string with a context must call i18nc() not i18n() anymore

IMPORTANT:
- this makes that the KDE4 versions of extractrc and extracattr
  are not compatible anymore to KDE3.
- developers having derived their own scripts from these tools
  (or having made scripts for similar tasks) must make the same changes too.

CCMAIL:kde-core-devel at kde.org


 M  +9 -4      extractattr  
 M  +9 -4      extractrc  


--- trunk/KDE/kdesdk/scripts/extractattr #573047:573048
@@ -27,7 +27,7 @@
 
                  --attr=Title,data --attr=Description,data,Stencils
 
---context=name : Give i18n calls a context name: i18n("name", ...)
+--context=name : Give i18n calls a context name: i18nc("name", ...)
 --lines        : Include source line numbers in comments (deprecated, it is switched on by default now)
 --help|?       : Display this summary
 
@@ -152,8 +152,13 @@
 
   print "//i18n: tag $tag attribute $attr\n";
   print "//i18n: file $file_name line $.\n";
-  print qq|i18n("|;
-  print qq|$context", "|            if $context;
-  print qq|$text");\n|;
+  if ( $context )
+  {
+    print qq|i18nc("$context","$text");\n|;
+  }
+  else
+  {
+    print  qq|i18n("$text");\n|;
+  }
 }
 
--- trunk/KDE/kdesdk/scripts/extractrc #573047:573048
@@ -19,7 +19,7 @@
 --tag-group=group : Use a group of tags - uses 'default' if omitted.
                     Valid groups are: @{[TAG_GROUPS()]}
 
---context=name    : Give i18n calls a context name: i18n("name", ...)
+--context=name    : Give i18n calls a context name: i18nc("name", ...)
 --lines           : Include source line numbers in comments (deprecated, it is switched on by default now)
 --help|?          : Display this summary
 
@@ -150,9 +150,14 @@
        print "//i18n: tag $tag\n";
        print "//i18n: file $file_name line $.\n";
        print "// xgettext: no-c-format\n";
-       print  q|i18n("|;
-       print qq|$context","|        if $context;   # We have a I18N context
-       print qq|$text");\n|;
+       if ( $context )
+       {
+         print qq|i18nc("$context","$text");\n|;
+       }
+       else
+       {
+         print  qq|i18n("$text");\n|;
+       }
      }
      else
      {




More information about the kde-core-devel mailing list