]> source.dussan.org Git - nextcloud-server.git/commitdiff
l18n support added to files_external/js
authorThomas Mueller <thomas.mueller@tmit.eu>
Tue, 2 Oct 2012 21:09:28 +0000 (23:09 +0200)
committerThomas Mueller <thomas.mueller@tmit.eu>
Tue, 2 Oct 2012 21:09:28 +0000 (23:09 +0200)
apps/files_external/js/dropbox.js
apps/files_external/js/google.js

index 6082fdd2cb7e1fff4e8201644cb8cb8054064785..c1e386407089e204ef0fd00d838f498591c4e55a 100644 (file)
@@ -4,7 +4,7 @@ $(document).ready(function() {
                var configured = $(this).find('[data-parameter="configured"]');
                if ($(configured).val() == 'true') {
                        $(this).find('.configuration input').attr('disabled', 'disabled');
-                       $(this).find('.configuration').append('<span id="access" style="padding-left:0.5em;">Access granted</span>');
+                       $(this).find('.configuration').append('<span id="access" style="padding-left:0.5em;">'+t('files_external', 'Access granted')+'</span>');
                } else {
                        var app_key = $(this).find('.configuration [data-parameter="app_key"]').val();
                        var app_secret = $(this).find('.configuration [data-parameter="app_secret"]').val();
@@ -22,14 +22,16 @@ $(document).ready(function() {
                                                        $(configured).val('true');
                                                        OC.MountConfig.saveStorage(tr);
                                                        $(tr).find('.configuration input').attr('disabled', 'disabled');
-                                                       $(tr).find('.configuration').append('<span id="access" style="padding-left:0.5em;">Access granted</span>');
+                                                       $(tr).find('.configuration').append('<span id="access" style="padding-left:0.5em;">'+t('files_external', 'Access granted')+'</span>');
                                                } else {
-                                                       OC.dialogs.alert(result.data.message, 'Error configuring Dropbox storage');
+                                                       OC.dialogs.alert(result.data.message,
+                                t('files_external', 'Error configuring Dropbox storage')
+                            );
                                                }
                                        });
                                }
                        } else if ($(this).find('.mountPoint input').val() != '' && $(config).find('[data-parameter="app_key"]').val() != '' && $(config).find('[data-parameter="app_secret"]').val() != '' && $(this).find('.dropbox').length == 0) {
-                               $(this).find('.configuration').append('<a class="button dropbox">Grant access</a>');
+                               $(this).find('.configuration').append('<a class="button dropbox">'+t('files_external', 'Grant access')+'</a>');
                        }
                }
        });
@@ -40,7 +42,7 @@ $(document).ready(function() {
                        var config = $(tr).find('.configuration');
                        if ($(tr).find('.mountPoint input').val() != '' && $(config).find('[data-parameter="app_key"]').val() != '' && $(config).find('[data-parameter="app_secret"]').val() != '') {
                                if ($(tr).find('.dropbox').length == 0) {
-                                       $(config).append('<a class="button dropbox">Grant access</a>');
+                                       $(config).append('<a class="button dropbox">'+t('files_external', 'Grant access')+'</a>');
                                } else {
                                        $(tr).find('.dropbox').show();
                                }
@@ -67,14 +69,22 @@ $(document).ready(function() {
                                        if (OC.MountConfig.saveStorage(tr)) {
                                                window.location = result.data.url;
                                        } else {
-                                               OC.dialogs.alert('Fill out all required fields', 'Error configuring Dropbox storage');
+                                               OC.dialogs.alert(
+                            t('files_external', 'Fill out all required fields'),
+                            t('files_external', 'Error configuring Dropbox storage')
+                        );
                                        }
                                } else {
-                                       OC.dialogs.alert(result.data.message, 'Error configuring Dropbox storage');
+                                       OC.dialogs.alert(result.data.message,
+                        t('files_external', 'Error configuring Dropbox storage')
+                    );
                                }
                        });
                } else {
-                       OC.dialogs.alert('Please provide a valid Dropbox app key and secret.', 'Error configuring Dropbox storage');
+                       OC.dialogs.alert(
+                t('files_external', 'Please provide a valid Dropbox app key and secret.'),
+                t('files_external', 'Error configuring Dropbox storage')
+            );
                }
        });
 
index 7c62297df4dc0945fe91873bc9a1905c7525b033..0b3c314eb5de5f309b466d8cf6c1f29c381ec0fc 100644 (file)
@@ -3,7 +3,8 @@ $(document).ready(function() {
        $('#externalStorage tbody tr.OC_Filestorage_Google').each(function() {
                var configured = $(this).find('[data-parameter="configured"]');
                if ($(configured).val() == 'true') {
-                       $(this).find('.configuration').append('<span id="access" style="padding-left:0.5em;">Access granted</span>');
+                       $(this).find('.configuration')
+                .append('<span id="access" style="padding-left:0.5em;">'+t('files_external', 'Access granted')+'</span>');
                } else {
                        var token = $(this).find('[data-parameter="token"]');
                        var token_secret = $(this).find('[data-parameter="token_secret"]');
@@ -19,13 +20,15 @@ $(document).ready(function() {
                                                $(token_secret).val(result.access_token_secret);
                                                $(configured).val('true');
                                                OC.MountConfig.saveStorage(tr);
-                                               $(tr).find('.configuration').append('<span id="access" style="padding-left:0.5em;">Access granted</span>');
+                                               $(tr).find('.configuration').append('<span id="access" style="padding-left:0.5em;">'+t('files_external', 'Access granted')+'</span>');
                                        } else {
-                                               OC.dialogs.alert(result.data.message, 'Error configuring Google Drive storage');
+                                               OC.dialogs.alert(result.data.message,
+                            t('files_external', 'Error configuring Google Drive storage')
+                        );
                                        }
                                });
                        } else if ($(this).find('.google').length == 0) {
-                               $(this).find('.configuration').append('<a class="button google">Grant access</a>');
+                               $(this).find('.configuration').append('<a class="button google">'+t('files_external', 'Grant access')+'</a>');
                        }
                }
        });
@@ -34,7 +37,7 @@ $(document).ready(function() {
                if ($(this).hasClass('OC_Filestorage_Google') && $(this).find('[data-parameter="configured"]').val() != 'true') {
                        if ($(this).find('.mountPoint input').val() != '') {
                                if ($(this).find('.google').length == 0) {
-                                       $(this).find('.configuration').append('<a class="button google">Grant access</a>');
+                                       $(this).find('.configuration').append('<a class="button google">'+t('files_external', 'Grant access')+'</a>');
                                }
                        }
                }
@@ -65,10 +68,15 @@ $(document).ready(function() {
                                if (OC.MountConfig.saveStorage(tr)) {
                                        window.location = result.data.url;
                                } else {
-                                       OC.dialogs.alert('Fill out all required fields', 'Error configuring Google Drive storage');
+                                       OC.dialogs.alert(
+                        t('files_external', 'Fill out all required fields'),
+                        t('files_external', 'Error configuring Google Drive storage')
+                    );
                                }
                        } else {
-                               OC.dialogs.alert(result.data.message, 'Error configuring Google Drive storage');
+                               OC.dialogs.alert(result.data.message,
+                    t('files_external', 'Error configuring Google Drive storage')
+                );
                        }
                });
        });