[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/stable/l10n-kde4/scripts
From:       Stephan Kulow <coolo () kde ! org>
Date:       2009-09-16 13:07:01
Message-ID: 1253106421.961364.25542.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1024363 by coolo:

also fix stable branch:
 - do not fall back from pt_BR to pt if pt_BR uses english
   original
 - write out any translation even if it's the same as english
   to fix possible fallbacks


 M  +10 -9     applycontext.cpp  
 M  +2 -2      merge_desktop_files.sh  


--- branches/stable/l10n-kde4/scripts/applycontext.cpp #1024362:1024363
@@ -1708,11 +1708,13 @@
                 }
 
 		for (int i = 2; i < argc; i++) {
+			char domain[PATH_MAX];
+			sprintf(domain, "apply_%s", argv[i]);
                         // Unlike for KDE3, the translated string has not the key!
-			const char *test = k_dcgettext(argv[0], lookup, argv[i]);
+			const char *test = k_dcgettext(domain, lookup, "abc");
 			
-                        if ( !strcmp ( test, lookup ) ) {
-                                // Exactly the same string, so there was no translation
+                        if ( test == lookup ) {
+                                // Exactly the same pointer, so there was no translation
                                 continue;
                         }
                         else if ( strchr( test, char( 4 ) ) ) {
@@ -1720,11 +1722,6 @@
                                 fprintf( stderr, "ERROR: translation contains char 4\n" );
                                 continue;
                         }
-			else if ( !strcmp( test, separator + 1 ) ) {
-                                // The translation is the same than the original (without context)
-				continue;
-                        }
-
 			if (strchr(test, '\n')) {
 				// We must avoid printing any control character
 				fprintf(stderr, "ERROR: %s's translation of \"%s\" contains a newline\n", argv[i], in);
@@ -1797,7 +1794,11 @@
     else
 	strcpy(kdedir, "/tmp/kde");
     strcat(kdedir, "/share/locale");
-    k_bindtextdomain(argv[0], kdedir);
+    for (int i = 2; i < argc; i++) {
+            char domain[PATH_MAX];
+            sprintf(domain, "apply_%s", argv[i]);
+            k_bindtextdomain(domain, kdedir);
+    }
 
     FILE *f = fopen(argv[1], "rt");
 
--- branches/stable/l10n-kde4/scripts/merge_desktop_files.sh #1024362:1024363
@@ -30,8 +30,8 @@
         continue
       fi
     fi
-    mkdir -p $KDEDIR/share/locale/$lang/LC_MESSAGES
-    if ! msgfmt $file -o $KDEDIR/share/locale/$lang/LC_MESSAGES/apply.mo; then 
+    mkdir -p $KDEDIR/share/locale/abc/LC_MESSAGES
+    if ! msgfmt $file -o $KDEDIR/share/locale/abc/LC_MESSAGES/apply_$lang.mo; then 
             echo "ERROR: file $file could not be processed by msgfmt!"
             continue
     fi
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic