From 9d3fb278999edb233eb1c2612412a06cd150e396 Mon Sep 17 00:00:00 2001
From: Bjoern Michaelsen <bjoern.michaelsen@canonical.com>
Date: Wed, 29 Jun 2011 19:15:31 +0200
Subject: [PATCH 6/9] lp#720716: more translations in desktop files

---
 sysui/desktop/menus/base.desktop                |    5 +
 sysui/desktop/menus/calc.desktop                |    5 +
 sysui/desktop/menus/draw.desktop                |    5 +
 sysui/desktop/menus/impress.desktop             |    5 +
 sysui/desktop/menus/math.desktop                |    5 +
 sysui/desktop/menus/writer.desktop              |    5 +
 sysui/desktop/share/launcher_comment.ulf        |  171 +++++++++++++++++++++++
 sysui/desktop/share/launcher_genericname.ulf    |  168 ++++++++++++++++++++++
 sysui/desktop/share/launcher_unityquicklist.ulf |  168 ++++++++++++++++++++++
 sysui/desktop/share/makefile.mk                 |    4 +-
 sysui/desktop/share/translate.pl                |   18 ++-
 11 files changed, 555 insertions(+), 4 deletions(-)
 create mode 100644 sysui/desktop/share/launcher_unityquicklist.ulf

Index: libreoffice-3.5.2/sysui/desktop/menus/base.desktop
===================================================================
--- libreoffice-3.5.2.orig/sysui/desktop/menus/base.desktop	2012-04-17 18:16:40.000000000 +0200
+++ libreoffice-3.5.2/sysui/desktop/menus/base.desktop	2012-04-17 18:27:52.271847122 +0200
@@ -10,3 +10,8 @@
 GenericName=Database Development
 Comment=Manage databases, create queries and reports to track and manage your information by using Base.
 InitialPreference=5
+X-Ayatana-Desktop-Shortcuts=New
+[New Shortcut Group]
+UnityQuicklist=New Database
+Exec=libreoffice --base %U
+TargetEnvironment=Unity
Index: libreoffice-3.5.2/sysui/desktop/menus/calc.desktop
===================================================================
--- libreoffice-3.5.2.orig/sysui/desktop/menus/calc.desktop	2012-04-17 18:27:52.111847119 +0200
+++ libreoffice-3.5.2/sysui/desktop/menus/calc.desktop	2012-04-17 18:27:52.271847122 +0200
@@ -10,3 +10,8 @@
 GenericName=Spreadsheet
 Comment=Perform calculations, analyze information and manage lists in spreadsheets by using Calc.
 InitialPreference=5
+X-Ayatana-Desktop-Shortcuts=New
+[New Shortcut Group]
+UnityQuicklist=New Spreadsheet
+Exec=libreoffice --calc %U
+TargetEnvironment=Unity
Index: libreoffice-3.5.2/sysui/desktop/menus/draw.desktop
===================================================================
--- libreoffice-3.5.2.orig/sysui/desktop/menus/draw.desktop	2012-04-17 18:27:52.111847119 +0200
+++ libreoffice-3.5.2/sysui/desktop/menus/draw.desktop	2012-04-17 18:27:52.275847121 +0200
@@ -10,3 +10,8 @@
 GenericName=Drawing Program
 Comment=Create and edit drawings, flow charts, and logos by using Draw.
 InitialPreference=5
+X-Ayatana-Desktop-Shortcuts=New
+[New Shortcut Group]
+UnityQuicklist=New Drawing
+Exec=libreoffice --draw %U
+TargetEnvironment=Unity
Index: libreoffice-3.5.2/sysui/desktop/menus/impress.desktop
===================================================================
--- libreoffice-3.5.2.orig/sysui/desktop/menus/impress.desktop	2012-04-17 18:27:52.111847119 +0200
+++ libreoffice-3.5.2/sysui/desktop/menus/impress.desktop	2012-04-17 18:27:52.275847121 +0200
@@ -10,3 +10,8 @@
 GenericName=Presentation
 Comment=Create and edit presentations for slideshows, meeting and Web pages by using Impress.
 InitialPreference=5
+X-Ayatana-Desktop-Shortcuts=New
+[New Shortcut Group]
+UnityQuicklist=New Presentation
+Exec=libreoffice --impress %U
+TargetEnvironment=Unity
Index: libreoffice-3.5.2/sysui/desktop/menus/math.desktop
===================================================================
--- libreoffice-3.5.2.orig/sysui/desktop/menus/math.desktop	2012-04-17 18:27:52.115847119 +0200
+++ libreoffice-3.5.2/sysui/desktop/menus/math.desktop	2012-04-17 18:27:52.275847121 +0200
@@ -11,3 +11,8 @@
 GenericName=Formula Editor
 Comment=Create and edit scientific formulas and equations by using Math.
 InitialPreference=5
+X-Ayatana-Desktop-Shortcuts=New
+[New Shortcut Group]
+UnityQuicklist=New Formula
+Exec=libreoffice --math %U
+TargetEnvironment=Unity
Index: libreoffice-3.5.2/sysui/desktop/menus/writer.desktop
===================================================================
--- libreoffice-3.5.2.orig/sysui/desktop/menus/writer.desktop	2012-04-17 18:27:52.115847119 +0200
+++ libreoffice-3.5.2/sysui/desktop/menus/writer.desktop	2012-04-17 18:27:52.275847121 +0200
@@ -10,3 +10,8 @@
 GenericName=Word Processor
 Comment=Create and edit text and graphics in letters, reports, documents and Web pages by using Writer.
 InitialPreference=5
+X-Ayatana-Desktop-Shortcuts=New
+[New Shortcut Group]
+UnityQuicklist=New Document
+Exec=libreoffice --writer %U
+TargetEnvironment=Unity
Index: libreoffice-3.5.2/sysui/desktop/share/launcher_unityquicklist.ulf
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ libreoffice-3.5.2/sysui/desktop/share/launcher_unityquicklist.ulf	2012-04-17 18:27:52.275847121 +0200
@@ -0,0 +1,168 @@
+[writer]
+en-US = "New Document"
+ast = "Documentu nuevu"
+ca = "Document nou"
+da = "Nyt dokument"
+de = "Neues Dokument"
+es = "Documento nuevo"
+el = "Νέο έγγραφο"
+fi = "Uusi tekstiasiakirja"
+fr = "Nouveau document"
+gl = "Novo documento"
+he = "מסמך חדש"
+hr = "Novi dokument"
+hu = "Új dokumentum"
+it = "Nuovo documento"
+is = "Nýtt textaskjal"
+ja = "新規文書を作成"
+ku = "Belgeya nû"
+nl = "Nieuw Document"
+pt_BR = "Novo documento"
+ro = "Document nou"
+ru = "Новый документ"
+sl = "Nov dokument"
+te = "కొత్త పత్రం"
+vi = "Tài liệu mới"
+zh_CN = "新建文档"
+zh_TW = "新增文件"
+
+[impress]
+en-US = "New Presentation"
+ast = "Presentación nueva"
+ca = "Presentació nova"
+da = "Ny præsentation"
+de = "Neue Präsentation"
+el = "Νέα παρουσίαση"
+es = "Presentación nueva"
+fi = "Uusi esitys"
+fr = "Nouvelle présentation"
+gl = "Nova presentación"
+he = "מצגת חדשה"
+hr = "Nova prezentacija"
+hu = "Új bemutató"
+it = "Nuova presentazione"
+is = "Ný skyggnusýning"
+ja = "新規プレゼンテーションを作成"
+nl = "Nieuwe presentatie"
+pt_BR = "Nova apresentação"
+ro = "Prezentare nouă"
+ru = "Новая презентация"
+sl = "Nova predstavitev"
+vi = "Trình diễn mới"
+zh_CN = "新建演示文稿"
+zh_TW = "新增簡報"
+
+[calc]
+en-US = "New Spreadsheet"
+ast = "Fueya de cálculu nueva"
+ca = "Full de càlcul nou"
+da = "Nyt regneark"
+de = "Neue Tabelle"
+el = "Δημιουργία Νέου λογιστικού φύλλου"
+es = "Hoja de cálculo nueva"
+fi = "Uusi taulukko"
+fr = "Nouvelle feuille de calcul"
+gl = "Nova folla de cálculo"
+he = "גיליון אלקטרוני חדש"
+hr = "Nova proračunska tablica"
+hu = "Új táblázat"
+it = "Nuovo foglio di calcolo"
+is = "Nýtt töflureikniblað"
+ja = "新規シートを作成"
+nl = "Nieuw Rekenblad"
+pt_BR = "Nova planilha"
+ro = "Foaie de calcul nouă"
+ru = "Новая электронная таблица"
+sl = "Nova preglednica"
+te = "కొత్త స్ప్రెడ్ షీట్"
+vi = "Bảng tính mới"
+zh_CN = "新建表格"
+zh_TW = "新增試算"
+
+[base]
+en-US = "New Database"
+ast = "Base de datos nueva"
+ca = "Base de dades nova"
+da = "Ny database"
+de = "Neue Datenbank"
+el = "Νέα βάση δεδομένων"
+es = "Base de datos nueva"
+fi = "Uusi tietokanta"
+fr = "Nouvelle base de données"
+gl = "Nova base de datos"
+he = "מסד נתונים חדש"
+hr = "Nova baza podataka"
+hu = "Új adatbázis"
+it = "Nuovo database"
+is = "Nýr Base gagnagrunnur"
+ja = "新規デ>ータベースを作成"
+nl = "Nieuwe database"
+nn = "Ny database"
+pt_BR = "Nova base de dados"
+ro = "Bază de date nouă"
+ru = "Новая база данных"
+sl = "Nova podatkovna zbirka"
+te = "కొత్త డాటాబేస్"
+vi = "Cơ sở dữ liệu mới"
+zh_CN = "新建数据库"
+zh_TW = "新增資料庫"
+
+[math]
+en-US = "New Formula"
+ast = "Fórmula nueva"
+ca = "Fórmula nova"
+da = "Ny formel"
+de = "Neue Formel"
+el = "Νέος τύπος"
+es = "Fórmula nueva"
+fi = "Uusi kaava"
+fr = "Nouvelle formule"
+gl = "Nova fórmula"
+he = "נוסחה חדשה"
+hr = "Nova jednadžba"
+hu = "Új képlet"
+it = "Nuova formula"
+is = "Ný formúla"
+ja = "新しい数式を作成"
+nl = "Nieuwe formule"
+pt_BR = "Nova fórmula"
+ro = "Formulă nouă"
+ru = "Новая формула"
+sl = "Nova formula"
+te = ""కొత్త సూత్రం
+vi = "Công thức mới"
+zh_CN = "新建公式"
+zh_TW = "新增公式"
+
+[draw]
+en-US = "New Drawing"
+ast = "Dibuxu nuevu"
+ca = "Dibuix nou"
+da = "Ny tegning"
+de = "Neue Zeichnung"
+el = "Νέα σχεδίαση"
+es = "Dibujo nuevo"
+fi = "Uusi piirros"
+fr = "Nouveau dessin"
+gl = "Novo debuxo"
+he = "ציור חדש"
+hr = "Nov crtež"
+hu = "Új rajz"
+it = "Nuovo disegno"
+is = "Ný teikning"
+ja = "新規画像を作成"
+nl = "Nieuwe tekening"
+pt_BR = "Novo desenho"
+ro = "Desen nou"
+ru = "Новый рисунок"
+sl = "Nova risba"
+te = "కొత్త చిత్రం"
+vi = "Hình vẽ mới"
+zh_CN = "新建绘图"
+zh_TW = "新增繪圖"
+
+[startcenter]
+en-US = ""
+
+[javafilter]
+en-US = ""
Index: libreoffice-3.5.2/sysui/desktop/share/makefile.mk
===================================================================
--- libreoffice-3.5.2.orig/sysui/desktop/share/makefile.mk	2012-04-17 18:27:52.115847119 +0200
+++ libreoffice-3.5.2/sysui/desktop/share/makefile.mk	2012-04-17 18:29:43.611848643 +0200
@@ -50,6 +50,7 @@
     documents.ulf \
     launcher_comment.ulf \
     launcher_genericname.ulf \
+    launcher_unityquicklist.ulf \
     launcher_name.ulf
 
 LAUNCHERLIST_APPS = writer calc draw impress math base printeradmin startcenter
@@ -146,15 +147,18 @@
 # merge-in the translations. 
 #
 
-$(LAUNCHERFLAGFILE) : ../productversion.mk brand.pl translate.pl $(ULFDIR)$/launcher_name.ulf $(ULFDIR)$/launcher_comment.ulf $(ULFDIR)/launcher_genericname.ulf
+$(LAUNCHERFLAGFILE) : ../productversion.mk brand.pl translate.pl $(ULFDIR)$/launcher_name.ulf $(ULFDIR)$/launcher_comment.ulf $(ULFDIR)/launcher_genericname.ulf $(ULFDIR)/launcher_unityquicklist.ulf
 $(LAUNCHERFLAGFILE) : $(LAUNCHERDEPN) 
     @@-$(MKDIRHIER) $(@:db).$(INPATH).$(@:f)
     @echo Creating desktop entries for $(@:f) ..
     @echo ---------------------------------
+    # overwrite the ulf generated from translations (which is empty)
+    @cp ./launcher_unityquicklist.ulf $(ULFDIR)
     @$(PERL) brand.pl -p '$${{PRODUCTNAME}} $${{PRODUCTVERSION}}' -u $(UNIXWRAPPERNAME) --iconprefix '$${{UNIXBASISROOTNAME}}-' $< $(@:db).$(INPATH).$(@:f)
     @$(PERL) translate.pl -p '$${{PRODUCTNAME}} $${{PRODUCTVERSION}}' -d $(@:db).$(INPATH).$(@:f) --ext "desktop" --key "Name" $(ULFDIR)$/launcher_name.ulf
     @$(PERL) translate.pl -p '$${{PRODUCTNAME}} $${{PRODUCTVERSION}}' -d $(@:db).$(INPATH).$(@:f) --ext "desktop" --key "Comment" $(ULFDIR)$/launcher_comment.ulf
     @$(PERL) translate.pl -p '$${{PRODUCTNAME}} $${{PRODUCTVERSION}}' -d $(@:db).$(INPATH).$(@:f) --ext "desktop" --key "GenericName" $(ULFDIR)$/launcher_genericname.ulf
+    @$(PERL) translate.pl -p '$${{PRODUCTNAME}} $${{PRODUCTVERSION}}' -d $(@:db).$(INPATH).$(@:f) --ext "desktop" --key "UnityQuicklist" $(ULFDIR)$/launcher_unityquicklist.ulf
 .IF "$(WITH_LIBSN)"=="YES"
     @noop x$(foreach,i,$(LAUNCHERLIST) $(shell @echo "StartupNotify=true" >> $(@:db).$(INPATH).$(@:f)/$i.desktop))x
 .ENDIF
Index: libreoffice-3.5.2/sysui/desktop/share/translate.pl
===================================================================
--- libreoffice-3.5.2.orig/sysui/desktop/share/translate.pl	2012-04-17 18:16:40.000000000 +0200
+++ libreoffice-3.5.2/sysui/desktop/share/translate.pl	2012-04-17 18:27:52.275847121 +0200
@@ -64,6 +64,12 @@
     }
 }
 
+# hack for unity section
+$outkey = $key;
+if ( $outkey eq "UnityQuicklist" ) {
+    $outkey = "Name";
+}
+
 # open input file
 unless (open(SOURCE, $ARGV[0])) {
     print STDERR "Can't open $ARGV[0] file: $!\n";
@@ -106,9 +112,12 @@
 
         # Pass the head of the template to the output file
 KEY:    while (<TEMPLATE>) {
-            print OUTFILE;
+            $keyline = $_;
             last KEY if (/$key/);
+            print OUTFILE;
         }
+        $keyline=~s/^$key/$outkey/;
+        print OUTFILE $keyline;
 
     } else {
         # split locale = "value" into 2 strings
@@ -125,10 +134,13 @@
             $value=~s/%PRODUCTNAME/$productname/g;
 
             $locale=~s/-/_/;
+
+            if (not $value eq '') {
             if ($ext eq "desktop") {
-                print OUTFILE "$key\[$locale\]=$value\n";
+                print OUTFILE "$outkey\[$locale\]=$value\n";
             } else {
-                print OUTFILE  "\t\[$locale\]$key=$value\n";
+                print OUTFILE  "\t\[$locale\]$outkey=$value\n";
+            }
             }
         }
     }
