From 823fba0c971b8ffda72e2735fdfa67be1fec9458 Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Fri, 10 Nov 2017 16:15:24 +0100 Subject: [PATCH] let's crowdin --- l10n/de.js | 64 ----- l10n/de.json | 74 ----- l10n/fr.js | 65 ----- l10n/fr.json | 80 ------ l10n/l10n.pl | 237 +++++++++++++++ l10n/templates/gpxedit.pot | 575 +++++++++++++++++++++++++++++++++++++ 6 files changed, 812 insertions(+), 283 deletions(-) delete mode 100644 l10n/de.js delete mode 100644 l10n/de.json delete mode 100644 l10n/fr.js delete mode 100644 l10n/fr.json create mode 100644 l10n/l10n.pl create mode 100644 l10n/templates/gpxedit.pot diff --git a/l10n/de.js b/l10n/de.js deleted file mode 100644 index 28a67ef..0000000 --- a/l10n/de.js +++ /dev/null @@ -1,64 +0,0 @@ -OC.L10N.register( - "gpxedit", - { - "Lat" : "Lat", - "Lon" : "Lon", - "Description" : "Beschreibung", - "Ok" : "Ok", - "Route" : "Route", - "Load folder" : "Lade Verzeichnis", - "Unknown symbol" : "Unbekanntes Symbol", - "Where to save" : "Wo speichern", - "Track" : "Track", - "Waypoint" : "Markierung", - "Name" : "Name", - "Comment" : "Kommentar", - "Symbol" : "Symbol", - "No symbol" : "kein Symbol", - "File successfully saved as" : "Datei erfolgreich gespeichert als:", - "There is nothing to save" : "Es gibt nichts zu speichern", - "Impossible to load this file. " : "Datei kann nicht geladen werden. ", - "Supported formats are gpx, kml, csv (unicsv) and jpg." : "Unterstützte Formate sind gpx, kml, csv (unicsv) und jpg", - "Load error" : "Fehler beim Laden", - "Impossible to write file" : "Kann Datei nicht schreiben", - "write access denied" : "Schreibzugriff verweigert", - "folder does not exist" : "Verzeichnis existiert nicht", - "folder write access denied" : "Schreibzugriff auf Verzeichnis verweigert", - "Bad file name, must end with \".gpx\"" : "Falscher Dateiname, er muss auf \".gpx\" enden", - "Load file (gpx, kml, csv, png)" : "Datei laden (gpx, kml, csv, png)", - "Failed to save file" : "Speichern der Datei fehlgeschlagen", - "Draw a track" : "Einen Track zeichnen", - "Add a waypoint" : "Eine Markierung hinzufügen", - "Edit" : "Bearbeiten", - "Nothing to edit" : "Nichts zu bearbeiten", - "Delete" : "Löschen", - "Nothing to delete" : "Nichts zu löschen", - "Cancel" : "Abbrechen", - "Discard all changes" : "Alle Änderungen verwerfen", - "Validate changes" : "Änderungen bestätigen", - "Drag to move elements,
click to remove a point
hover a middle marker and press \"Del\" to cut the line" : "Ziehen verschiebt Elemente,
Klick entfernt einen Punkt
Über einen \"middle marker\" bewegen und \"Entf\" drücken zerschneidet einen Weg.", - "Click cancel to undo changes": "Auf Abbrechen klicken um die Änderungen zu verwerfen", - "Click on an element to delete it" : "Auf ein Element klicken um es zu löschen", - "Click map to add waypoint" : "In die Karte klicken um eine Markierung hinzuzufügen", - "Click to start drawing track" : "Klicken, um einen neuen Weg zu zeichnen", - "Click to continue drawing track" : "Klicken, um das Zeichnen eines Weges fortzuführen", - "Click last point to finish track" : "Klick auf den letzen Punkt beendet den Weg", - "Cancel drawing" : "Zeichnen abbrechen", - "Finish" : "Beenden", - "Finish drawing" : "Zeichnen beenden", - "Delete last point" : "Letzten Punkt löschen", - "Delete last point drawn" : "Letzten gezeichneten Punkt löschen", - "Server name or server url should not be empty" : "Servername oder Server-URL dürfen nicht leer sein", - "A server with this name already exists" : "Ein Server mit diesem Namen existiert bereits", - "Impossible to add tile server" : "Tile-Server kann nicht hinzugefügt werden", - "Failed to restore options values" : "Wiederherstellen der Einstellungen fehlgeschlagen", - "Failed to save options values" : "Speichern der Einstellungen fehlgeschlagen", - "Edit with GpxEdit" : "Mit GpxEdit bearbeiten", - "Load in GpxEdit" : "In GpxEdit laden", - "Tile server \"{ts}\" has been deleted" : "Tile-Server \"{ts}\" wurde gelöscht", - "Tile server \"{ts}\" has been added" : "Tile-Server \"{ts}\" wurde hinzugefügt", - "Failed to add tile server \"{ts}\"" : "Kann Tile-Server \"{ts}\" nicht hinzufügen", - "Failed to delete tile server \"{ts}\"" : "Kann Tile-Server \"{ts}\" nicht löschen", - "Error" : "Fehler" - }, -"nplurals=2; plural=(n > 1);"); diff --git a/l10n/de.json b/l10n/de.json deleted file mode 100644 index 44bcae8..0000000 --- a/l10n/de.json +++ /dev/null @@ -1,74 +0,0 @@ -{ "translations": { - "GpxEdit" : "GpxEdit", - "Options" : "Einstellungen", - "Shortcuts" : "Shortcuts", - "Documentation" : "Dokumentation", - "toggle sidebar" : "Sidebar umschalten", - "toggle minimap" : "kleine Karte umschalten", - "Authors" : "Autoren", - "exporting file to gpx" : "Datei als gpx exportieren", - "permanent" : "permanent", - "all files" : "Alle Dateien", - "Source management" : "Quellcodeverwaltung", - "saving file" : "speichere Datei", - "Load and save files" : "Dateien laden und speichern", - "loading file" : "lade Datei", - "Choose directory and save" : "Verzeichnis wählen und speichern", - "About GpxEdit" : "Über GpxEdit", - "Load file" : "Datei laden", - "Load directory" : "Verzeichnis laden", - "Save" : "Speichern", - "File name" : "Dateiname", - "Description (optional)" : "Beschreibung (optional)", - "Clear map" : "Karte löschen", - "Waypoint style" : "Markierungstyp", - "Tooltip" : "Tooltip", - "on hover" : "beim Überfahren", - "Use defined symbols instead of default symbol" : "Benutze definierte Symbole anstatt dem Standardsymbol", - "Use defined symbols" : "Benutze definierte Symbole", - "Custom tile servers" : "Eigene Kachel-Server", - "Server name" : "Servername", - "For example : my custom server" : "Zum Beispiel: Mein XY-Server", - "Server url" : "Server-URL", - "For example : http://tile.server.org/cycle/{z}/{x}/{y}.png" : "Zum Beispiel: http://tile.server.org/cycle/{z}/{x}/{y}.png", - "For example : http://overlay.server.org/cycle/{z}/{x}/{y}.png" : "Zum Beispiel: http://overlay.server.org/cycle/{z}/{x}/{y}.png", - "Add" : "Hinzufügen", - "Delete" : "Löschen", - "Default symbol for waypoints when value is not set" : "Standardsymbol für Markierungen", - "Clear map before loading" : "Lösche Karte vor dem Laden", - "Features overview" : "Feature-Überblick", - "Draw, edition and deletion buttons are in the map's bottom-left corner." : "Buttons zum Zeichnen, Bearbeiten und Löschen sind in der linken unteren Ecke der Karte.", - "You can draw a line or add a marker." : "Sie können einen Weg zeichnen oder eine Markierung hinzufügen.", - "If you click on a line or a marker, a popup pops and let you set the object properties." : "Mit einem Klick auf einen Weg oder eine Markierung können Sie die Eigenschaften des Objekts in einem Popup-Fenster bearbeiten.", - "After a click on \"edition\" button, in edition mode, you can" : "Nach einem Klick auf \"bearbeiten\" können Sie im Bearbeiten-Modus", - "move markers" : "Markierungen verschieben", - "move line points" : "Punkte eines Weges verschieben", - "click on a line point to remove it" : "auf einen Punkt eines Weges klicken, um ihn zu löschen", - "hover a \"middle marker\" (between two line points) and press \"Del\" to cut the line in two (this action cannot be canceled)" : "über der Mitten-Markierung zwischen zwei Punkten eines Weges auf \"Entf\" drücken, um den Weg in zwei Teile zu spalten (diese Aktion kann nicht rückgängig gemacht werden)", - "Extra symbols" : "Zusätzliche Symbole", - "Those symbols will be available in GpxEdit." : "Diese Symbole sind in GpxEdit verfügbar", - "Keep in mind that only symbol names are saved in gpx files. Other programs will display default symbol if they do not know a symbol name." : "Nur die Namen der Symbole werden in der GPX-Datei abgelegt. Andere Programme stellen ein Standard-Symbol dar, wenn sie diesen Namen nicht kennen.", - "Recommended image ratio : 1:1" : "Empfohlenes Bildverhältnis : 1:1", - "Recommended image resolution : between 24x24 and 50x50" : "Empfohlene Bildgröße: zwischen 24x24 und 50x50", - "Accepted image format : png" : "Erlaubtes Bildformat: png", - "New symbol name" : "Name für das neue Symbol", - "Approximate new points elevations" : "Höhe für neue Punkte mitteln", - "Min zoom (1-20)" : "min. Zoom (1-20)", - "Opacity (0.0-1.0)" : "Deckkraft (0.0-1.0)", - "Format" : "Format", - "Custom overlay tile servers" : "Eigene Overlay-Kachel-Server", - "Your tile servers" : "Eigene Kachel-Server", - "WMS version" : "WMS-Version", - "Your WMS tile servers" : "Eigene WMS-Server", - "Max zoom (1-20)" : "max. Zoom (1-20)", - "Custom WMS overlay servers" : "Eigene WMS-Overlay-Server", - "Layers to display" : "anzuzeigende Layer", - "Custom WMS tile servers" : "Eigene WMS-Server", - "Your overlay tile servers" : "Eigene Overlay-Kachel-Server", - "Your WMS overlay tile servers" : "Eigene WMS-Overlay-Server", - "Transparent" : "Transparent", - "Link URL (optional)" : "Link-URL (optional)", - "Link text (optional)" : "Link-Text (optional)", - "Upload new symbol image" : "Neues Symbol hochladen" -},"pluralForm" :"nplurals=2; plural=(n > 1);" -} diff --git a/l10n/fr.js b/l10n/fr.js deleted file mode 100644 index 97f9778..0000000 --- a/l10n/fr.js +++ /dev/null @@ -1,65 +0,0 @@ -OC.L10N.register( - "gpxedit", - { - "Lat" : "Lat", - "Lon" : "Lon", - "Description" : "Description", - "Ok" : "Ok", - "Route" : "Route", - "Load folder" : "Charger un dossier", - "Unknown symbol" : "Symbole inconnu", - "Where to save" : "Où enregistrer", - "Track" : "Trace", - "Waypoint" : "Étape", - "Name" : "Nom", - "Comment" : "Commentaire", - "Symbol" : "Symbole", - "No symbol" : "Aucun symbole", - "File successfully saved as" : "Fichier enregistré avec succès :", - "There is nothing to save" : "Il n'y a rien à sauver", - "Impossible to load this file. " : "Impossible de charger ce fichier. ", - "Supported formats are gpx, kml, csv (unicsv) and jpg." : "Les formats pris en charge sont gpx, kml, csv (unicsv) et jpg", - "Load error" : "Erreur de chargement", - "Impossible to write file" : "Impossible d'écrire le fichier", - "write access denied" : "Droit d'accès d'écriture refusé", - "folder does not exist" : "Le dossier n'existe pas", - "folder write access denied" : "Droit d'accès d'écriture pour le dossier refusé", - "Bad file name, must end with \".gpx\"" : "Nom mal formé, doit finir par \".gpx\"", - "Load file (gpx, kml, csv, png)" : "Charger un fichier (gpx, kml, csv, png)", - "Failed to save file" : "Échec à l'enregistrement du fichier", - "Draw a track" : "Dessiner une trace", - "Add a waypoint" : "Ajouter une étape", - "Edit" : "Éditer", - "Nothing to edit" : "Rien à éditer", - "Delete" : "Effacer", - "Nothing to delete" : "Rien à effacer", - "Cancel" : "Annuler", - "Discard all changes" : "Annuler tous les changements", - "Validate changes" : "Valider les changements", - "Drag to move elements,
click to remove a point
hover a middle marker and press \"Del\" to cut the line" : "Déplacer par glisser-déposer,
cliquer sur un point pour le supprimer
survoler un \"middle marker\" et presser la touche \"Suppr\" pour couper la ligne", - "Click cancel to undo changes": "Cliquer sur annuler pour défaire les changements", - "Click on an element to delete it" : "Cliquer sur un élément pour l'effacer", - "Click map to add waypoint" : "Cliquer sur la carte pour ajouter une étape", - "Click to start drawing track" : "Cliquer pour commencer à dessiner une trace", - "Click to continue drawing track" : "Cliquer pour continuer à dessiner une trace", - "Click last point to finish track" : "Cliquer sur le dernier point pour terminer la trace", - "Cancel drawing" : "Annuler le dessin", - "Finish" : "Terminer", - "Finish drawing" : "Terminer le dessin", - "Delete last point" : "Supprimer le dernier point", - "Delete last point drawn" : "Supprimer le dernier point dessiné", - "Server name or server url should not be empty" : "L'URL ou le nom du serveur doivent être non vides", - "A server with this name already exists" : "Un serveur avec ce nom existe déjà", - "Impossible to add tile server" : "Impossible d'ajouter le serveur de tuiles", - "Failed to restore options values" : "Echec du chargement des valeurs des options", - "Failed to save options values" : "Echec à la sauvegarde des valeurs des options", - "Edit with GpxEdit" : "Éditer avec GpxEdit", - "Load in GpxEdit" : "Charger dans GpxEdit", - "Tile server \"{ts}\" has been deleted" : "Le serveur de tuiles \"{ts}\" a été supprimé", - "Tile server \"{ts}\" has been added" : "Le serveur de tuiles \"{ts}\" a été ajouté", - "Failed to add tile server \"{ts}\"" : "Échec de l'ajout du serveur de tuiles \"{ts}\"", - "Failed to delete tile server \"{ts}\"" : "Échec de la suppression du serveur de tuiles \"{ts}\"", - "Error" : "Erreur" - }, -"nplurals=2; plural=(n > 1);"); - diff --git a/l10n/fr.json b/l10n/fr.json deleted file mode 100644 index f1c0992..0000000 --- a/l10n/fr.json +++ /dev/null @@ -1,80 +0,0 @@ -{ "translations": { - "GpxEdit" : "GpxEdit", - "Options" : "Options", - "Shortcuts" : "Raccourcis clavier", - "Documentation" : "Documentation", - "toggle sidebar" : "montrer/cacher la barre latérale", - "toggle minimap" : "montrer/cacher la mini carte", - "Authors" : "Auteurs", - "exporting file to gpx" : "export en gpx", - "permanent" : "permanent", - "all files" : "tous les fichiers", - "Source management" : "Gestion des sources", - "saving file" : "sauvegarde du fichier", - "Load and save files" : "Charger et enregistrer des fichiers", - "loading file" : "chargement du fichier", - "Choose directory and save" : "Choisir un dossier et sauver", - "About GpxEdit" : "À propos de GpxEdit", - "Load file" : "Charger un fichier", - "Load directory" : "Charger un dossier", - "Save" : "Enregistrer", - "File name" : "Nom de fichier", - "Description (optional)" : "Description (facultatif)", - "Clear map" : "Vider la carte", - "Waypoint style" : "Style des étapes", - "Tooltip" : "Info-bulle", - "on hover" : "au survol", - "Use defined symbols instead of default symbol" : "Utilise les symboles définis au lieu du symbole par défaut", - "Use defined symbols" : "Utiliser les symboles définis", - "Custom tile servers" : "Serveurs de tuiles personnels", - "Server name" : "Nom du serveur", - "For example : my custom server" : "Par exemple : mon super serveur", - "Server url" : "URL du serveur", - "For example : http://tile.server.org/cycle/{z}/{x}/{y}.png" : "Par exemple : http://tile.server.org/cycle/{z}/{x}/{y}.png", - "For example : http://overlay.server.org/cycle/{z}/{x}/{y}.png" : "Par exemple : http://overlay.server.org/cycle/{z}/{x}/{y}.png", - "Add" : "Ajouter", - "Delete" : "Supprimer", - "Default symbol for waypoints when value is not set" : "Symbole par défaut pour les étapes si non défini", - "Clear map before loading" : "Vider la carte avant de charger", - "Features overview" : "Aperçu des fonctionnalités", - "Draw, edition and deletion buttons are in the map's bottom-left corner." : "Les boutons de dessin, édition et suppression sont dans le coin inférieur gauche de la carte.", - "You can draw a line or add a marker." : "Vous pouvez dessiner une ligne ou ajouter un marqueur.", - "If you click on a line or a marker, a popup pops and let you set the object properties." : "Si vous cliquez sur une ligne ou un marqueur, une popup apparait et vous permet de définir les propriétés de l'objet.", - "After a click on \"edition\" button, in edition mode, you can" : "Après un clic sur le bouton \"édition\", en mode édition, vous pouvez", - "move markers" : "déplacer les marqueurs", - "move line points" : "déplacer les points des lignes", - "click on a line point to remove it" : "cliquer sur un point d'une ligne pour le supprimer", - "hover a \"middle marker\" (between two line points) and press \"Del\" to cut the line in two (this action cannot be canceled)" : "survoler un \"middle marker\" (entre deux points d'une ligne) et presser la touche \"Suppr\" pour couper la ligne en deux (cette action ne peut pas être annulée)", - "Extra symbols" : "Symboles supplémentaires", - "Those symbols will be available in GpxEdit." : "Ces symboles seront disponibles dans GpxEdit", - "Keep in mind that only symbol names are saved in gpx files. Other programs will display default symbol if they do not know a symbol name." : "Gardez à l'esprit que seuls les noms de symboles sont sauvés dans les fichiers gpx. D'autres programmes afficheront un symbole par défaut s'ils ne connaissent pas un nom de symbole.", - "Recommended image ratio : 1:1" : "Ratio d'image recommandé : 1:1", - "Recommended image resolution : between 24x24 and 50x50" : "Résolution d'image recommandée : entre 24x24 et 50x50", - "Accepted image format : png" : "Format d'image accepté : png", - "New symbol name" : "Nom du nouveau symbole", - "Approximate new points elevations" : "Approximer l'altitude des nouveaux points", - "Min zoom (1-20)" : "Zoom mini (1-20)", - "Opacity (0.0-1.0)" : "Opacité (0.0-1.0)", - "Format" : "Format", - "Custom overlay tile servers" : "Serveurs de revêtement personnels", - "Your tile servers" : "Vos serveurs de tuiles personnels", - "WMS version" : "Version de WMS", - "Your WMS tile servers" : "Vos serveurs de tuiles WMS personnels", - "Max zoom (1-20)" : "Zoom maxi (1-20)", - "Custom WMS overlay servers" : "Serveurs de revêtement WMS", - "Layers to display" : "Layers à afficher", - "Custom WMS tile servers" : "Serveurs de tuiles WMS personnels", - "Your overlay tile servers" : "Vos serveurs de revêtements personnels", - "Your WMS overlay tile servers" : "Vos serveurs de revêtements WMS personnels", - "Transparent" : "Transparent", - "Link URL (optional)" : "URL du lien (facultatif)", - "Link text (optional)" : "Texte du lien (facultatif)", - "Track name (optional)" : "Nom de la trace (facultatif)", - "Metadata" : "Métadonnées", - "Units (needs page reload to take effect)" : "Unités (effectif après rechargement de la page)", - "English" : "Anglaises", - "Metric" : "Métriques", - "Nautical" : "Nautiques", - "Upload new symbol image" : "Téléverser une nouvelle image de symbole" -},"pluralForm" :"nplurals=2; plural=(n > 1);" -} diff --git a/l10n/l10n.pl b/l10n/l10n.pl new file mode 100644 index 0000000..8286ed7 --- /dev/null +++ b/l10n/l10n.pl @@ -0,0 +1,237 @@ +#!/usr/bin/perl +use strict; +use Locale::PO; +use Cwd; +use Data::Dumper; +use File::Path; + +sub crawlPrograms{ + my( $dir, $ignore ) = @_; + my @found = (); + print "$dir crawl PROGRAMS\n"; + print "ignore $ignore\n"; + + opendir( DIR, $dir ); + my @files = readdir( DIR ); + closedir( DIR ); + @files = sort( @files ); + print "FILE $_\n" for @files; + + foreach my $i ( @files ){ + next if substr( $i, 0, 1 ) eq '.'; + print "i : $i et $ignore\n"; + if( !($i eq 'l10n') && !$ignore ){ + push( @found, $dir ); + } + elsif( -d $dir.'/'.$i ){ + push( @found, crawlPrograms( $dir.'/'.$i )); + } + } + + print "end crawl LIST FOUND :\n"; + print "FOUND $_\n" for @found; + return @found; +} + +sub crawlFiles{ + print "crawl FILES\n"; + my( $dir ) = @_; + my @found = (); + + opendir( DIR, $dir ); + my @files = readdir( DIR ); + closedir( DIR ); + @files = sort( @files ); + + foreach my $i ( @files ){ + next if substr( $i, 0, 1 ) eq '.'; + next if $i eq 'l10n'; + + if( -d $dir.'/'.$i ){ + push( @found, crawlFiles( $dir.'/'.$i )); + } + else{ + push(@found,$dir.'/'.$i) if $i =~ /.*(?){ + my $line = $_; + chomp($line); + $ignore{"./$line"}++; + } + close(IN); + return %ignore; +} + +sub getPluralInfo { + my( $info ) = @_; + + # get string + $info =~ s/.*Plural-Forms: (.+)\\n.*/$1/; + $info =~ s/^(.*)\\n.*/$1/g; + + return $info; +} + +sub init() { + # let's get the version from stdout of xgettext + my $out = `xgettext --version`; + # we assume the first line looks like this 'xgettext (GNU gettext-tools) 0.19.3' + $out = substr $out, 29, index($out, "\n")-29; + $out =~ s/^\s+|\s+$//g; + $out = "v" . $out; + my $actual = version->parse($out); + # 0.18.3 introduced JavaScript as a language option + my $expected = version->parse('v0.18.3'); + if ($actual < $expected) { + die( "Minimum expected version of xgettext is " . $expected . ". Detected: " . $actual ); + } +} + +init(); + +my $task = shift( @ARGV ); +my $place = '..'; + +die( "Usage: l10n.pl task\ntask: read, write\n" ) unless $task && $place; + +# Our current position +my $whereami = cwd(); +die( "Program must be executed in a l10n-folder called 'l10n'" ) unless $whereami =~ m/\/l10n$/; + +# Where are i18n-files? +my @dirs = crawlPrograms( $place, 1 ); + +# Languages +my @languages = (); +opendir( DIR, '.' ); +my @files = readdir( DIR ); +closedir( DIR ); +foreach my $i ( @files ){ + push( @languages, $i ) if -d $i && substr( $i, 0, 1 ) ne '.'; +} + +if( $task eq 'read' ){ + rmtree( 'templates' ); + mkdir( 'templates' ) unless -d 'templates'; + print "Mode: readingg\n"; + foreach my $dir ( @dirs ){ + print "$dir"; + my @temp = split( /\//, $dir ); + my $app = pop( @temp ); + chdir( $dir ); + # parses the app info and creates an dummy file specialAppInfoFakeDummyForL10nScript.php + `php $whereami/../build/l10nParseAppInfo.php`; + my @totranslate = crawlFiles('.'); + my %ignore = readIgnorelist(); + my $output = "${whereami}/templates/gpxedit.pot"; + print "OUUUUUUUUUUUUUUUUUUUUUUUUU $output"; + print " Processing $app\n"; + + foreach my $file ( @totranslate ){ + print "$file"; + next if $ignore{$file}; + my $keywords = ''; + if( $file =~ /\.js$/ ){ + $keywords = '--keyword=t:2 --keyword=n:2,3'; + } + else{ + $keywords = '--keyword=t --keyword=n:1,2'; + } + my $language = ( $file =~ /\.js$/ ? 'Javascript' : 'PHP'); + my $joinexisting = ( -e $output ? '--join-existing' : ''); + print " Reading $file\n"; + `xgettext --output="$output" $joinexisting $keywords --language=$language "$file" --add-comments=TRANSLATORS --from-code=UTF-8 --package-version="8.0.0" --package-name="ownCloud Core" --msgid-bugs-address="translations\@owncloud.org"`; + } + rmtree( "specialAppInfoFakeDummyForL10nScript.php" ); + chdir( $whereami ); + } +} +elsif( $task eq 'write' ){ + print "Mode: write\n"; + foreach my $dir ( @dirs ){ + my @temp = split( /\//, $dir ); + my $app = pop( @temp ); + chdir( $dir.'/l10n' ); + print " Processing $app\n"; + foreach my $language ( @languages ){ + next if $language eq 'templates'; + + my $input = "${whereami}/$language/gpxedit.po"; + next unless -e $input; + + print " Language $language\n"; + my $array = Locale::PO->load_file_asarray( $input ); + # Create array + my @strings = (); + my @js_strings = (); + my $plurals; + + TRANSLATIONS: foreach my $string ( @{$array} ){ + if( $string->msgid() eq '""' ){ + # Translator information + $plurals = getPluralInfo( $string->msgstr()); + } + elsif( defined( $string->msgstr_n() )){ + # plural translations + my @variants = (); + my $msgid = $string->msgid(); + $msgid =~ s/^"(.*)"$/$1/; + my $msgid_plural = $string->msgid_plural(); + $msgid_plural =~ s/^"(.*)"$/$1/; + my $identifier = "_" . $msgid."_::_".$msgid_plural . "_"; + + foreach my $variant ( sort { $a <=> $b} keys( %{$string->msgstr_n()} )){ + next TRANSLATIONS if $string->msgstr_n()->{$variant} eq '""'; + push( @variants, $string->msgstr_n()->{$variant} ); + } + + push( @strings, "\"$identifier\" => array(".join(",", @variants).")"); + push( @js_strings, "\"$identifier\" : [".join(",", @variants)."]"); + } + else{ + # singular translations + next TRANSLATIONS if $string->msgstr() eq '""'; + push( @strings, $string->msgid()." => ".$string->msgstr()); + push( @js_strings, $string->msgid()." : ".$string->msgstr()); + } + } + next if $#strings == -1; # Skip empty files + + for (@strings) { + s/\$/\\\$/g; + } + + # delete old php file + unlink "$language.php"; + + # Write js file + open( OUT, ">$language.js" ); + print OUT "OC.L10N.register(\n \"gpxedit\",\n {\n "; + print OUT join( ",\n ", @js_strings ); + print OUT "\n},\n\"$plurals\");\n"; + close( OUT ); + + # Write json file + open( OUT, ">$language.json" ); + print OUT "{ \"translations\": "; + print OUT "{\n "; + print OUT join( ",\n ", @js_strings ); + print OUT "\n},\"pluralForm\" :\"$plurals\"\n}"; + close( OUT ); + + } + chdir( $whereami ); + } +} +else{ + print "unknown task!\n"; +} diff --git a/l10n/templates/gpxedit.pot b/l10n/templates/gpxedit.pot new file mode 100644 index 0000000..eebffb3 --- /dev/null +++ b/l10n/templates/gpxedit.pot @@ -0,0 +1,575 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the ownCloud Core package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: ownCloud Core 8.0.0\n" +"Report-Msgid-Bugs-To: translations@owncloud.org\n" +"POT-Creation-Date: 2017-11-10 16:14+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: app.php:42 admin.php:7 +msgid "GpxEdit" +msgstr "" + +#: admin.js:15 gpxedit.js:403 gpxedit.js:1269 admin.php:27 gpxcontent.php:165 +#: gpxcontent.php:209 gpxcontent.php:255 gpxcontent.php:305 +msgid "Delete" +msgstr "" + +#: filetypes.js:11 +msgid "Load in GpxEdit" +msgstr "" + +#: filetypes.js:36 +msgid "Edit with GpxEdit" +msgstr "" + +#: gpxedit.js:399 +msgid "Draw a track" +msgstr "" + +#: gpxedit.js:400 +msgid "Add a waypoint" +msgstr "" + +#: gpxedit.js:401 +msgid "Edit" +msgstr "" + +#: gpxedit.js:402 +msgid "Nothing to edit" +msgstr "" + +#: gpxedit.js:404 +msgid "Nothing to delete" +msgstr "" + +#: gpxedit.js:405 +msgid "Validate changes" +msgstr "" + +#: gpxedit.js:406 +msgid "Ok" +msgstr "" + +#: gpxedit.js:407 +msgid "Discard all changes" +msgstr "" + +#: gpxedit.js:408 gpxedit.js:416 +msgid "Cancel" +msgstr "" + +#: gpxedit.js:409 +msgid "" +"Drag to move elements,
click to remove a point
hover a middle marker " +"and press \"Del\" to cut the line" +msgstr "" + +#: gpxedit.js:410 +msgid "Click cancel to undo changes" +msgstr "" + +#: gpxedit.js:411 +msgid "Click on an element to delete it" +msgstr "" + +#: gpxedit.js:412 +msgid "Click map to add waypoint" +msgstr "" + +#: gpxedit.js:413 +msgid "Click to start drawing track" +msgstr "" + +#: gpxedit.js:414 +msgid "Click to continue drawing track" +msgstr "" + +#: gpxedit.js:415 +msgid "Click last point to finish track" +msgstr "" + +#: gpxedit.js:417 +msgid "Cancel drawing" +msgstr "" + +#: gpxedit.js:418 +msgid "Finish" +msgstr "" + +#: gpxedit.js:419 +msgid "Finish drawing" +msgstr "" + +#: gpxedit.js:420 +msgid "Delete last point" +msgstr "" + +#: gpxedit.js:421 +msgid "Delete last point drawn" +msgstr "" + +#: gpxedit.js:486 +msgid "Track" +msgstr "" + +#: gpxedit.js:491 +msgid "Route" +msgstr "" + +#: gpxedit.js:496 +msgid "Waypoint" +msgstr "" + +#: gpxedit.js:501 +msgid "Name" +msgstr "" + +#: gpxedit.js:502 +msgid "Description" +msgstr "" + +#: gpxedit.js:503 +msgid "Comment" +msgstr "" + +#: gpxedit.js:505 +msgid "Lat" +msgstr "" + +#: gpxedit.js:507 +msgid "Lon" +msgstr "" + +#: gpxedit.js:509 +msgid "Symbol" +msgstr "" + +#: gpxedit.js:512 +msgid "No symbol" +msgstr "" + +#: gpxedit.js:514 +msgid "Unknown symbol" +msgstr "" + +#: gpxedit.js:975 +msgid "Failed to save file" +msgstr "" + +#: gpxedit.js:993 +msgid "File successfully saved as" +msgstr "" + +#: gpxedit.js:1104 +msgid "Impossible to load this file. " +msgstr "" + +#: gpxedit.js:1105 +msgid "Supported formats are gpx, kml, csv (unicsv) and jpg." +msgstr "" + +#: gpxedit.js:1106 +msgid "Load error" +msgstr "" + +#: gpxedit.js:1209 +msgid "Tile server \"{ts}\" has been deleted" +msgstr "" + +#: gpxedit.js:1212 gpxedit.js:1216 +msgid "Failed to delete tile server \"{ts}\"" +msgstr "" + +#: gpxedit.js:1231 +msgid "Server name or server url should not be empty" +msgstr "" + +#: gpxedit.js:1232 gpxedit.js:1237 +msgid "Impossible to add tile server" +msgstr "" + +#: gpxedit.js:1236 +msgid "A server with this name already exists" +msgstr "" + +#: gpxedit.js:1302 +msgid "Tile server \"{ts}\" has been added" +msgstr "" + +#: gpxedit.js:1305 gpxedit.js:1309 +msgid "Failed to add tile server \"{ts}\"" +msgstr "" + +#: gpxedit.js:1381 +msgid "Failed to restore options values" +msgstr "" + +#: gpxedit.js:1382 gpxedit.js:1437 +msgid "Error" +msgstr "" + +#: gpxedit.js:1436 +msgid "Failed to save options values" +msgstr "" + +#: gpxedit.js:1503 gpxedit.js:1510 gpxedit.js:1517 +msgid "Impossible to write file" +msgstr "" + +#: gpxedit.js:1504 +msgid "write access denied" +msgstr "" + +#: gpxedit.js:1511 +msgid "folder does not exist" +msgstr "" + +#: gpxedit.js:1518 +msgid "folder write access denied" +msgstr "" + +#: gpxedit.js:1524 +msgid "Bad file name, must end with \".gpx\"" +msgstr "" + +#: gpxedit.js:1636 +msgid "Load file (gpx, kml, csv, png)" +msgstr "" + +#: gpxedit.js:1653 +msgid "Load folder" +msgstr "" + +#: gpxedit.js:1665 +msgid "There is nothing to save" +msgstr "" + +#: gpxedit.js:1670 +msgid "Where to save" +msgstr "" + +#: leaflet.js:5 +msgid "left" +msgstr "" + +#: leaflet.js:5 +msgid "right" +msgstr "" + +#: admin.php:8 +msgid "Extra symbols" +msgstr "" + +#: admin.php:9 +msgid "Those symbols will be available in GpxEdit." +msgstr "" + +#: admin.php:10 +msgid "" +"Keep in mind that only symbol names are saved in gpx files. Other programs " +"will display default symbol if they do not know a symbol name." +msgstr "" + +#: admin.php:34 +msgid "Recommended image ratio : 1:1" +msgstr "" + +#: admin.php:35 +msgid "Recommended image resolution : between 24x24 and 50x50" +msgstr "" + +#: admin.php:36 +msgid "Accepted image format : png" +msgstr "" + +#: admin.php:38 +msgid "New symbol name" +msgstr "" + +#: admin.php:42 +msgid "Upload new symbol image" +msgstr "" + +#: gpxcontent.php:4 +msgid "Load and save files" +msgstr "" + +#: gpxcontent.php:5 gpxcontent.php:106 +msgid "Options" +msgstr "" + +#: gpxcontent.php:6 gpxcontent.php:316 +msgid "About GpxEdit" +msgstr "" + +#: gpxcontent.php:24 +msgid "Load file" +msgstr "" + +#: gpxcontent.php:25 +msgid "Load directory" +msgstr "" + +#: gpxcontent.php:27 +msgid "all files" +msgstr "" + +#: gpxcontent.php:35 +msgid "Save" +msgstr "" + +#: gpxcontent.php:37 +msgid "File name" +msgstr "" + +#: gpxcontent.php:40 +msgid "Metadata" +msgstr "" + +#: gpxcontent.php:42 +msgid "Track name (optional)" +msgstr "" + +#: gpxcontent.php:44 +msgid "Description (optional)" +msgstr "" + +#: gpxcontent.php:46 +msgid "Link text (optional)" +msgstr "" + +#: gpxcontent.php:48 +msgid "Link URL (optional)" +msgstr "" + +#: gpxcontent.php:51 +msgid "Choose directory and save" +msgstr "" + +#: gpxcontent.php:54 +msgid "Clear map" +msgstr "" + +#: gpxcontent.php:65 +msgid "loading file" +msgstr "" + +#: gpxcontent.php:69 +msgid "exporting file to gpx" +msgstr "" + +#: gpxcontent.php:73 +msgid "saving file" +msgstr "" + +#: gpxcontent.php:109 +msgid "Default symbol for waypoints when value is not set" +msgstr "" + +#: gpxcontent.php:110 +msgid "Waypoint style" +msgstr "" + +#: gpxcontent.php:114 +msgid "Tooltip" +msgstr "" + +#: gpxcontent.php:116 +msgid "on hover" +msgstr "" + +#: gpxcontent.php:117 +msgid "permanent" +msgstr "" + +#: gpxcontent.php:119 +msgid "Units (needs page reload to take effect)" +msgstr "" + +#: gpxcontent.php:121 +msgid "Metric" +msgstr "" + +#: gpxcontent.php:122 +msgid "English" +msgstr "" + +#: gpxcontent.php:123 +msgid "Nautical" +msgstr "" + +#: gpxcontent.php:125 gpxcontent.php:127 +msgid "Use defined symbols instead of default symbol" +msgstr "" + +#: gpxcontent.php:126 +msgid "Use defined symbols" +msgstr "" + +#: gpxcontent.php:129 +msgid "Clear map before loading" +msgstr "" + +#: gpxcontent.php:131 +msgid "Approximate new points elevations" +msgstr "" + +#: gpxcontent.php:135 +msgid "Custom tile servers" +msgstr "" + +#: gpxcontent.php:138 gpxcontent.php:178 gpxcontent.php:222 gpxcontent.php:268 +msgid "Server name" +msgstr "" + +#: gpxcontent.php:139 gpxcontent.php:179 gpxcontent.php:223 gpxcontent.php:269 +msgid "For example : my custom server" +msgstr "" + +#: gpxcontent.php:140 gpxcontent.php:180 gpxcontent.php:224 gpxcontent.php:270 +msgid "Server url" +msgstr "" + +#: gpxcontent.php:141 gpxcontent.php:225 +msgid "For example : http://tile.server.org/cycle/{z}/{x}/{y}.png" +msgstr "" + +#: gpxcontent.php:142 gpxcontent.php:182 gpxcontent.php:226 gpxcontent.php:272 +msgid "Min zoom (1-20)" +msgstr "" + +#: gpxcontent.php:144 gpxcontent.php:184 gpxcontent.php:228 gpxcontent.php:274 +msgid "Max zoom (1-20)" +msgstr "" + +#: gpxcontent.php:146 gpxcontent.php:190 gpxcontent.php:236 gpxcontent.php:286 +msgid "Add" +msgstr "" + +#: gpxcontent.php:149 +msgid "Your tile servers" +msgstr "" + +#: gpxcontent.php:175 +msgid "Custom overlay tile servers" +msgstr "" + +#: gpxcontent.php:181 gpxcontent.php:271 +msgid "For example : http://overlay.server.org/cycle/{z}/{x}/{y}.png" +msgstr "" + +#: gpxcontent.php:186 gpxcontent.php:276 +msgid "Transparent" +msgstr "" + +#: gpxcontent.php:188 gpxcontent.php:278 +msgid "Opacity (0.0-1.0)" +msgstr "" + +#: gpxcontent.php:193 +msgid "Your overlay tile servers" +msgstr "" + +#: gpxcontent.php:219 +msgid "Custom WMS tile servers" +msgstr "" + +#: gpxcontent.php:230 gpxcontent.php:280 +msgid "Format" +msgstr "" + +#: gpxcontent.php:232 gpxcontent.php:282 +msgid "WMS version" +msgstr "" + +#: gpxcontent.php:234 gpxcontent.php:284 +msgid "Layers to display" +msgstr "" + +#: gpxcontent.php:239 +msgid "Your WMS tile servers" +msgstr "" + +#: gpxcontent.php:265 +msgid "Custom WMS overlay servers" +msgstr "" + +#: gpxcontent.php:289 +msgid "Your WMS overlay tile servers" +msgstr "" + +#: gpxcontent.php:318 +msgid "Features overview" +msgstr "" + +#: gpxcontent.php:320 +msgid "Draw, edition and deletion buttons are in the map's bottom-left corner." +msgstr "" + +#: gpxcontent.php:322 +msgid "You can draw a line or add a marker." +msgstr "" + +#: gpxcontent.php:324 +msgid "" +"If you click on a line or a marker, a popup pops and let you set the object " +"properties." +msgstr "" + +#: gpxcontent.php:329 +msgid "After a click on \"edition\" button, in edition mode, you can" +msgstr "" + +#: gpxcontent.php:332 +msgid "move markers" +msgstr "" + +#: gpxcontent.php:333 +msgid "move line points" +msgstr "" + +#: gpxcontent.php:334 +msgid "click on a line point to remove it" +msgstr "" + +#: gpxcontent.php:335 +msgid "" +"hover a \"middle marker\" (between two line points) and press \"Del\" to cut " +"the line in two (this action cannot be canceled)" +msgstr "" + +#: gpxcontent.php:338 +msgid "Shortcuts" +msgstr "" + +#: gpxcontent.php:340 +msgid "toggle sidebar" +msgstr "" + +#: gpxcontent.php:341 +msgid "toggle minimap" +msgstr "" + +#: gpxcontent.php:344 +msgid "Documentation" +msgstr "" + +#: gpxcontent.php:352 +msgid "Source management" +msgstr "" + +#: gpxcontent.php:363 +msgid "Authors" +msgstr ""