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

List:       kde-commits
Subject:    l10n-support
From:       Karl Ove Hufthammer <null () kde ! org>
Date:       2018-07-12 12:57:04
Message-ID: E1fdb9c-0008Jv-SH () code ! kde ! org
[Download RAW message or body]

SVN commit 1519643 by huftis:

Use one set of summit config files for the Norwegian languages (instead of a separate \
set for the summit and the branches).

 D             nn/posummit-filer (directory)  
 M  +9 -65     nn/skript/kde-l10n-synk.sh  
 M  +35 -6     scripts/summit_helpers_NO.py  


--- trunk/l10n-support/nn/skript/kde-l10n-synk.sh #1519642:1519643
@@ -61,9 +61,9 @@
 # Ensure we can run pology scripts directly, without specifying a path.
 export PATH=$L10NS/pology/bin:$PATH
 
-SVN_COMMAND="svn --quiet" # SVN command
+SVN_COMMAND="echo svn --quiet" # SVN command
 
-sprak="nn nb"         # The languages the script should handle
+sprak="nn"         # The languages the script should handle
 hjelpetekstar="nei"   # Should the docs files be updated too?
 kjapp="ja"            # "ja": Do a quick merge, on only PO files with updated \
templates; "no": merge all PO files  
@@ -136,65 +136,10 @@
 {
   echo -e "\n═══ Oppdaterer omsettingsfilene med dei nyaste malfilene \
═══"  
-  # Fetch updated PO and POT files.
-  echo  "─── Hentar oppdaterte omsettingsfiler og malfiler ───"
-  cd $L10NS
-  $SVN_COMMAND up --accept theirs-full *
-
-  for sprk in $sprak # For each language
-  do
-    if [ $sprk = "nn" ]; then
-      langsprk="Norwegian Nynorsk"
-    elif [ $sprk = "nb" ]; then
-      langsprk="Norwegian Bokmål"
-    elif [ $sprk = "se" ]; then
-      langsprk="Northern Sami"
-    fi
-    
-    # Do some automatic search and replace (should be improved to use pology tools).
-    echo "  ─ Automatisk søk og byt ut for språkkoden  ${sprk}  ─"
-    find $sprk -name '*.po' | while read fil # For each PO file, do the following
-    do
-      namn=$(basename ${fil%.po}) # Remove the .po extension
-
-      # Update the header, with the text ‘Translation of APPNAME to LANGUAGE' at \
                the top,
-      # and remove all other lines than the list of translators.
-      sed -i -r '1,/^msg/{/^#[^@]*$/d}' $fil
-      sed -i -r "1,1s/(.*)/# Translation of $namn to $langsprk\n#\n\1/" $fil
-      
-      # Some automatic ‘search and replace' …
-      # Doing it this way (instead of with ‘sed -i') to ensure no trailing \
                newlines.
-      endra=$(sed -f nn/skript/feilfiksar $fil)
-      echo "$endra" > $fil
-      if [[ $(basename $fil) = 'blinken.po' ]]; then # Do not change  ...  to  \
                …  in blinken.
-          sed -i 's/…/.../g' $fil
-      fi
-    done # for each PO file
-    
-    # Commit the automatic changes.
-    $SVN_COMMAND up --accept theirs-full $sprk
-    $SVN_COMMAND commit -m "SVN_SILENT Automatic fixes for ${langsprk}." \
                $sprk/summit
-    
-    for mappe in $mapper
-    do
-      echo "  ─ Oppdaterer omsettingsfilene i  ${mappe}  for språkkoden  \
                ${sprk}  med nyaste malfiler ─"
-      posummit $tving nn/posummit-filer/${mappe#summit/}.summit $sprk merge
-    done
-    $SVN_COMMAND up --accept theirs-full $sprk
-    $SVN_COMMAND commit -m "SVN_SILENT Merged translation files for ${langsprk} with \
                latest templates." $sprk/summit
-  done # for each language
-} # oppdater_po done
-
-
-# Copy the translations to KDE's SVN repository.
-function tilbake_po
-{
-  echo -e "\n═══ Fører omsettingane tilbake til KDE-SVN ═══"
-  
   # Update all the KDE SVN folders.
   echo "─── Hentar nyaste omsettingsfiler, malar og skript ───"
-  $SVN_COMMAND up $KDEREPO/{trunk,branches/stable}/{l10n-kde4,l10n-kf5,l10n-kf5-plasma-lts}/{scripts,templates,nb,nn,se}
                
-  $SVN_COMMAND up $KDEREPO/trunk/l10n-support/{scripts,templates,pology,nb,nn,se}
+  $SVN_COMMAND up --accept theirs-full \
$KDEREPO/{trunk,branches/stable}/{l10n-kde4,l10n-kf5,l10n-kf5-plasma-lts}/{scripts,templates,nb,nn,se}
 +  $SVN_COMMAND up --accept theirs-full \
$KDEREPO/trunk/l10n-support/{scripts,templates,pology,nb,nn,se}  $SVN_COMMAND up -N \
$KDEREPO/trunk/l10n-support/  
   # Copy and commit the actual translation files. 
@@ -212,9 +157,9 @@
     fi
     
     cd $L10NS
-    echo "  ─ Spreier omsettingane frå summit til stable og trunk o.l. ─"
+    echo "  ─ Oppdaterer omsettingsfiler og spreier omsettingane frå summit til \
stable og trunk o.l. ─"  
-    # Scatter the messages files, and possibly the docmessages files.
+    # Merge and scatter the messages files, and possibly the docmessages files.
     for mappe in $mapper
     do
       echo "  ─ Spreier omsettingsfilene i  ${mappe}  for språkkoden  ${sprk} \
 med nyaste malfiler ─" @@ -232,7 +177,7 @@
       rsync -r --exclude='.svn*' --delete $L10NS/${sprk}/summit/scripts \
$KDEREPO/${kdemappe}/$sprk/  done
 
-    for kdemappe in trunk/l10n-kf5 branches/stable/l10n-kf5 \
branches/stable/l10n-kf5-plasma-lts trunk/l10n-kde4 branches/stable/l10n-kde4 +    \
for kdemappe in trunk/l10n-kf5 branches/stable/l10n-kf5 \
branches/stable/l10n-kf5-plasma-lts trunk/l10n-kde4 branches/stable/l10n-kde4 \
trunk/l10n-support/  do
     # Commit any updated translation files to KDE
     cd $KDEREPO/${kdemappe}/$sprk
@@ -241,7 +186,7 @@
     $SVN_COMMAND commit -m "SVN_SILENT Updated $langsprk translations." $sprk
     done
   done
-} #  tilbake_po done
+} #  oppdater_po done
 
 
 # Generate the docmentation DocBook files.
@@ -280,8 +225,7 @@
   
 Kommandoar:
   lag_kompendium Lag kompendium over alle tekstane i omsettingane.
-  oppdater_po    Oppdater omsettingsfilene med nytt frå malane.
-  tilbake_po     Overfør omsettingsfilene tilbake til KDE (trunk og ulike greiner).
+  oppdater_po    Oppdater omsettingsfilene med nytt frå malane og sprei omsette \
tekstar.  lag_dok        Lag og send inn hjelpefiler basert på omsettingane i \
KDE-SVN.  alt            Gjer alt ovanfor (i rekkjefølgje)."
 elif [ $val = alt ]; then
--- trunk/l10n-support/scripts/summit_helpers_NO.py #1519642:1519643
@@ -3,6 +3,7 @@
 import re
 
 from pology.normalize import canonical_header
+from pology.proj.kde.header import equip_header as equip_header_tp_kde
 
 
 def setup_common_extras (S, langcode, langname, teamaddr):
@@ -14,6 +15,29 @@
     # Do not make fuzzy messages when merging branch catalogs.
     S.branches_fuzzy_merging = False
 
+    # Compendium to use when merging summit catalogs.
+    S.compendium_on_merge = S.relpath("../../nn/skript/kompendium/%s.po" % S.lang)
+    S.compendium_fuzzy_exact = True
+    S.merge_rebase_fuzzy = True
+    S.merge_min_adjsim_fuzzy=.6
+
+    # ----------------------------------------
+    # Formatting.
+
+    # Wrap messages?
+    S.summit_wrap = False
+    S.branches_wrap = True
+
+    # Fine-wrap messages (on markup tags, etc.)?
+    S.summit_fine_wrap = True
+    S.branches_fine_wrap = False
+
+    # ----------------------------------------
+    # Bookkeeping.
+
+    # Version control system for the catalogs, if any.
+    S.version_control = "svn"
+    
     S.hook_on_merge_cat.extend([
         # Remove obsolete messages from branch catalogs.
         (remove_obsolete, lambda bid: bid != "+"),
@@ -20,11 +44,14 @@
     ])
     
     S.hook_on_merge_head.extend([
-        # Clean up the PO header by removing comments
-        (build_cleanup_header_hook(langname),),
+        # Clean up the PO header
+        (build_cleanup_header_hook(langcode, langname, teamaddr),),
         
         # Reorder/normalise the authors list
         (canonical_header,),
+        
+        # Set some common headers
+        (equip_header_tp_kde,),
     ])
 
     # Do some search and replace stuff for Norwegian Nynorsk
@@ -50,11 +77,14 @@
     return hook
 
 
-# Clean up the PO header by setting a standard title
-# and removing all comments except the authors list
-def build_cleanup_header_hook (langname):
+# Clean up the PO header by adding/fixing some common headers,
+# setting a standard header title, and removing all header
+# comments except the authors list
+def build_cleanup_header_hook (langcode, langname, teamaddr):
 
     def cleanup_header (hdr, cat):
+        hdr.set_field(u"Language-Team", u"%s <%s>" % (langname, teamaddr))
+        hdr.set_field(u"Plural-Forms", u"nplurals=2; plural=n != 1;")
         hdr.title[:] = [u'Translation of %s to %s' % (cat.name, langname), u'']
         hdr.license = None
         hdr.copyright = None
@@ -81,4 +111,3 @@
     for msg in cat:
         if msg.obsolete:
             cat.remove_on_sync(msg)
-


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

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