diff --git a/app/assets/javascripts/app/controllers/translation.coffee b/app/assets/javascripts/app/controllers/translation.coffee index 3280f0e4f..a1a70da11 100644 --- a/app/assets/javascripts/app/controllers/translation.coffee +++ b/app/assets/javascripts/app/controllers/translation.coffee @@ -164,14 +164,16 @@ class Index extends App.ControllerSubContent type: 'GET' url: "#{@apiPath}/translations/sync/#{locale.locale}" processData: false - complete: (data, status, xhr) => + success: => loader.update(locale.name, false) locale = locales.shift() if _.isEmpty(locales) hide() return @_syncChanges(locale, locales, loader, hide) - ) + error: -> + hide() + ) updateOnServer: (params, event) => diff --git a/test/browser/translation_test.rb b/test/browser/translation_test.rb index 8a71ac2d2..a218f9894 100644 --- a/test/browser/translation_test.rb +++ b/test/browser/translation_test.rb @@ -2,6 +2,7 @@ require 'browser_test_helper' class TranslationTest < TestCase + def test_preferences @browser = browser_instance login( @@ -250,4 +251,60 @@ class TranslationTest < TestCase ) end + + def test_admin_sync + @browser = browser_instance + login( + username: 'master@example.com', + password: 'test', + url: browser_url, + ) + tasks_close_all() + + click(css: 'a[href="#current_user"]') + click(css: 'a[href="#profile"]') + click(css: 'a[href="#profile/language"]') + select( + css: '.language_item [name="locale"]', + value: 'Deutsch', + ) + click(css: '.content.active button[type="submit"]') + watch_for( + css: 'body', + value: 'Sprache', + ) + + click(css: 'a[href="#manage"]') + click(css: 'a[href="#system/translation"]') + + watch_for( + css: '.content.active', + value: 'Inline Übersetzung', + ) + + click(css: '.content.active .js-syncChanges') + watch_for( + css: '.content.active .modal', + value: 'Letzte Übersetzung laden', + ) + watch_for_disappear( + css: '.content.active .modal', + timeout: 5 * 60, + ) + + click(css: 'a[href="#current_user"]') + click(css: 'a[href="#profile"]') + click(css: 'a[href="#profile/language"]') + select( + css: '.language_item [name="locale"]', + value: 'English (United States)', + ) + click(css: '.content.active button[type="submit"]') + watch_for( + css: 'body', + value: 'Language', + ) + + end + end