Am Mo, 13 Aug 2012 um 12:38 GMT +0200 schrieb Stefan Göckeritz:

Hello list,

> There are lots of small little hints that come from JS in ownCloud,
> that are hardcoded.
>
IMHO this should be reported as a (minor) bug. I cannot create an
account at the bug tracker
(http://bugs.owncloud.org/thebuggenie/owncloud/), "404 - Not Found".

> I know the translation function is there and can simply be used in the JS.
> Anyway I feel like I don't want to dive into all the little code
> snippets, should I do it though, or should I wait for the app
> creator/maintainer to do this (Which unfortunately didn#t work for a
> long time now)?
> 

> >>As I look at the sources, I saw that this text was hardcoded at the
> >>JavaScript file "apps/files_sharing/js/share.js".
> >>
For the apps (namely files_sharing), theres little effort to add
translations to the module.

I've added a l10n directory to the module and created a file de.php
for German localizations.

At the JS code I add the t('<module>','<string>') function calls.

Have the patch appended to this email.

BTW: Whats the "official" way to submit patches to OC?

Best regards,
Martin Werthmoeller

-- 
LWsystems - IT-Service and Consulting
[email protected] * http://www.lw-systems.de
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js
index e49fa94..b6f4d0b 100644
--- a/apps/files/js/fileactions.js
+++ b/apps/files/js/fileactions.js
@@ -163,7 +163,7 @@ FileActions.register('all','Delete',function(){return OC.imagePath('core','actio
 	$('.tipsy').remove();
 });
 
-FileActions.register('all',t('files','Rename'),function(){return OC.imagePath('core','actions/rename')},function(filename){
+FileActions.register('all','Rename',function(){return OC.imagePath('core','actions/rename')},function(filename){
 	FileList.rename(filename);
 });
 
diff --git a/apps/files/l10n/de.php b/apps/files/l10n/de.php
index 568417d..9c5310c 100644
--- a/apps/files/l10n/de.php
+++ b/apps/files/l10n/de.php
@@ -6,8 +6,7 @@
 "No file was uploaded" => "Es wurde keine Datei hochgeladen.",
 "Missing a temporary folder" => "Temporärer Ordner fehlt.",
 "Failed to write to disk" => "Fehler beim Schreiben auf Festplatte",
-"File" => "Datei",
-"Files" => "Dateien",
+"Files" => "Files",
 "Size" => "Größe",
 "Modified" => "Bearbeitet",
 "File handling" => "Dateibehandlung",
@@ -28,15 +27,8 @@
 "Share" => "Teilen",
 "Download" => "Herunterladen",
 "Delete" => "Löschen",
-"Delete all" => "Alle löschen",
 "Upload too large" => "Upload zu groß",
 "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Die Datei überschreitet die Maximalgröße für Uploads auf diesem Server.",
 "Files are being scanned, please wait." => "Daten werden gescannt, bitte warten.",
-"file" => "Datei",
-"fieles" => "Dateien",
-"folder" => "Ordner",
-"folders" => "Ordner",
-"Rename" => "Umbenennen",
-"Unshare" => "Nicht teilen",
 "Current scanning" => "Scannen"
 );
diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js
index 03725f9..1ad5187 100644
--- a/apps/files_sharing/js/share.js
+++ b/apps/files_sharing/js/share.js
@@ -60,7 +60,7 @@ OC.Share={
 	showDropDown:function(item, appendTo) {
 		OC.Share.loadItem(item);
 		var html = '<div id="dropdown" class="drop" data-item="'+item+'">';
-		html += '<select data-placeholder="'+t('files_sharing','User or Group')+'" id="share_with" class="chzen-select">';
+		html += '<select data-placeholder="User or Group" id="share_with" class="chzen-select">';
 		html += '<option value=""></option>';
 		html += '</select>';
 		html += '<div id="sharedWithList">';
@@ -72,12 +72,12 @@ OC.Share={
 		html += '</div>';
 		html += '</div>';
 		html += '<div id="privateLink">';
-		html += '<input type="checkbox" name="privateLinkCheckbox" id="privateLinkCheckbox" value="1" /><label for="privateLinkCheckbox">'+t('files_sharing','Share with private link')+'</label>';
+		html += '<input type="checkbox" name="privateLinkCheckbox" id="privateLinkCheckbox" value="1" /><label for="privateLinkCheckbox">Share with private link</label>';
 		html += '<br />';
 		html += '<form id="emailPrivateLink">';
 		html += '<input id="privateLinkText" style="display:none; width:90%;" />';
-		html += '<input id="email" style="display:none; width:65%;" value="" placeholder="'+t('files_sharing','Email link to person')+'" />';
-		html += '<input id="emailButton" style="display:none;" type="submit" value="'+t('files_sharing','Send')+'" />';
+		html += '<input id="email" style="display:none; width:65%;" value="" placeholder="Email link to person" />';
+		html += '<input id="emailButton" style="display:none;" type="submit" value="Send" />';
 		html += '</form>';
 		html += '</div>';
 		$(html).appendTo(appendTo);
@@ -372,4 +372,4 @@ $(document).ready(function() {
 		event.preventDefault();
 		OC.Share.emailPrivateLink();
 	});
-});
+});
\ No newline at end of file
diff --git a/apps/files_sharing/l10n/de.php b/apps/files_sharing/l10n/de.php
deleted file mode 100644
index 7bbd3cd..0000000
--- a/apps/files_sharing/l10n/de.php
+++ /dev/null
@@ -1,6 +0,0 @@
-<?php $TRANSLATIONS = array(
-  'User or Group' => 'Benutzer oder Gruppe',
-  'Share with private link' => 'Per Link teilen',
-  'Email link to person' => 'E-Mail Adresse',
-  'Send' => 'Ok',
-);
diff --git a/apps/files_versions/js/versions.js b/apps/files_versions/js/versions.js
index 7da47c0..5e46b2a 100644
--- a/apps/files_versions/js/versions.js
+++ b/apps/files_versions/js/versions.js
@@ -11,7 +11,7 @@ $(document).ready(function() {
 $(document).ready(function(){
 	if (typeof FileActions !== 'undefined') {
 		// Add history button to files/index.php
-		FileActions.register('file',t('files_versions','History'),function(){return OC.imagePath('core','actions/history')},function(filename){
+		FileActions.register('file','History',function(){return OC.imagePath('core','actions/history')},function(filename){
 
 			if (scanFiles.scanning){return;}//workaround to prevent additional http request block scanning feedback
 			
@@ -38,12 +38,12 @@ function createVersionsDropdown(filename, files) {
 	
 	var html = '<div id="dropdown" class="drop" data-file="'+files+'">';
 	html += '<div id="private">';
-	html += '<select data-placeholder="'+t('files_versions','Saved versions')+'" id="found_versions" class="chzen-select" style="width:16em;">';
+	html += '<select data-placeholder="Saved versions" id="found_versions" class="chzen-select" style="width:16em;">';
 	html += '<option value=""></option>';
 	html += '</select>';
 	html += '</div>';
 	//html += '<input type="button" value="Revert file" onclick="revertFile()" />';
-	html += '<input type="button" value="'+t('files_versions','All versions')+'..." onclick="window.location=\''+historyUrl+'\'" name="makelink" id="makelink" />';
+	html += '<input type="button" value="All versions..." onclick="window.location=\''+historyUrl+'\'" name="makelink" id="makelink" />';
 	html += '<input id="link" style="display:none; width:90%;" />';
 	
 	if (filename) {
@@ -71,7 +71,7 @@ function createVersionsDropdown(filename, files) {
 			} else {
 				$('#found_versions').hide();
 				$('#makelink').hide();
-				$('<div style="text-align:center;">'+t('files_versions','No other versions available')+'</div>').appendTo('#dropdown');
+				$('<div style="text-align:center;">No other versions available</div>').appendTo('#dropdown');
 			}
 			$('#found_versions').change(function(){
 				var revision=parseInt($(this).val());
diff --git a/apps/files_versions/l10n/de.php b/apps/files_versions/l10n/de.php
deleted file mode 100644
index c810efa..0000000
--- a/apps/files_versions/l10n/de.php
+++ /dev/null
@@ -1,7 +0,0 @@
-<?php $TRANSLATIONS = array(
-  'All versions' => 'Alle Versionen',
-  'History' => 'Versionen',
-  'No other versions available' => 'Keine Versionen verfügbar',
-  'Saved versions' => 'Gespeicherte Versionen',
-);
-
_______________________________________________
Owncloud mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/owncloud

Reply via email to