Repository: spyder-ide/spyder

Issue:
Update translations for 4.0.0
Version **4.0.0** is almost ready, so now it has come the time to update our translations for this release.

This is a call to all our translators to update their respective translations. Please create separate pull requests for each language:

- Hungarian
  - @martindurant 
- French
  - @goanpeca 
  - @Prikers
  - @jnsebgosselin  
- Japanese
  - @sohnishi
- Portuguese (Brazilian)
  - @manipuladordedados
- Russian
  - @burrbull
  - @Qlogin
- Spanish
  - @ccordoba12
  - @juanis2112 

Thanks for your help!

---

**Important notes**:

1. We could wait for you until Monday November 25 at 00:00 am UTC for your pull requests. There are 490 strings to be updated or translated, so please let us know if you need more time.
2. You can make your pull requests against the **master** branch.
PR: Add russian auto translation
<!--- Make sure to read the Contributing Guidelines:                   --->
<!--- https://github.com/spyder-ide/spyder/blob/master/CONTRIBUTING.md --->
<!--- and follow PEP 8, PEP 257 and Spyder's code style:               --->
<!--- https://github.com/spyder-ide/spyder/wiki/Dev:-Coding-Style      --->

## Description of Changes





<!--- Explain what you've done and why --->




### Issue(s) Resolved

<!--- List the issue(s) below, in the form "Fixes #1234"; one per line --->

Related to https://github.com/spyder-ide/spyder/issues/10672


### Affirmation

By submitting this Pull Request or typing my (user)name below,
I affirm the [Developer Certificate of Origin](https://developercertificate.org)
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.

<!--- TYPE YOUR USER/NAME AFTER THE FOLLOWING: --->
I certify the above statement is true and correct:

<!--- Thanks for your help making Spyder better for everyone! --->



Discussion:
@goanpeca do you need help with the French translation (which is my native language) or does Prikers still have the time to do it?
@jnsebgosselin if you could take a stab at it it would be great!! :-) 
Or you could work together in the same PR, because it's a lot of work. That's what I plan to do with @juanis2112!
> 
> 
> Or you could work together in the same PR, because it's a lot of work. That's what I plan to do with @juanis2112!

Ok, this is a good plan, I will open a PR to start the work on this.
Thanks @jnsebgosselin!
Thanks :-) !
I'm sorry, I am pretty swamped right now, unlikely to be able to spend any time on this
No problem Martin. Perhaps you could catch up for Spyder 4.1, to be released in three months?
Hi everyone, we decided to delay the final release one more week due to some nasty bugs that appeared in our second release candidate. So now you have time to upload your translations until November 30 at 00:00 am UTC.

To give you an additional hand with that, @goanpeca created PRs for those who have not yet submitted one, with the help of Google translator.

We really hope you find time to review and finish those PRs. Else we'll probably be forced to deactivate your languages due to the large amount of new strings in Spyder 4, which represent almost a third of all strings in our interface now. So a language for which translations are not updated would look very patchy, i.e. with a lot of strings in English instead of being native.

Thanks for your help!
Hi @burrbull and @Qlogin, I added automatic (google) translation so you could start reviewing the work when you have some time :-)

Thanks!

Resolving patch:
diff --git a/spyder/config/base.py b/spyder/config/base.py
--- a/spyder/config/base.py
+++ b/spyder/config/base.py
@@ -347,19 +347,20 @@ def get_image_path(name, default="not_found.png"):
 
 # This needs to be updated every time a new language is added to spyder, and is
 # used by the Preferences configuration to populate the Language QComboBox
-LANGUAGE_CODES = {'en': u'English',
-                  'fr': u'Français',
-                  'es': u'Español',
-                  'hu': u'Magyar',
-                  'pt_BR': u'Português',
-                  'ru': u'Русский',
-                  'zh_CN': u'简体中文',
-                  'ja': u'日本語',
-                  'de': u'Deutsch'
-                  }
+LANGUAGE_CODES = {
+    'en': u'English',
+    'fr': u'Français',
+    'es': u'Español',
+    'hu': u'Magyar',
+    'pt_BR': u'Português',
+    'ru': u'Русский',
+    'zh_CN': u'简体中文',
+    'ja': u'日本語',
+    'de': u'Deutsch'
+}
 
 # Disabled languages (because their translations are outdated)
-DISABLED_LANGUAGES = []
+DISABLED_LANGUAGES = ['hu', 'ru']
 
 def get_available_translations():
     """
@@ -420,8 +421,8 @@ def get_interface_language():
             if locale_language == lang:
                 language = locale_language
                 break
-            elif locale_language.startswith(lang) or \
-              lang.startswith(locale_language):
+            elif (locale_language.startswith(lang) or
+                    lang.startswith(locale_language)):
                 language = lang
                 break
 
diff --git a/spyder/preferences/general.py b/spyder/preferences/general.py
--- a/spyder/preferences/general.py
+++ b/spyder/preferences/general.py
@@ -20,17 +20,19 @@
 from qtpy.QtWidgets import (QApplication, QButtonGroup, QGridLayout, QGroupBox,
                             QHBoxLayout, QLabel, QMessageBox, QTabWidget,
                             QVBoxLayout)
-if sys.platform == "darwin":
-    import applaunchservices as als
 
-from spyder.config.base import (_, LANGUAGE_CODES, running_in_mac_app,
-                                save_lang_conf)
+from spyder.config.base import (_, DISABLED_LANGUAGES, LANGUAGE_CODES,
+                                running_in_mac_app, save_lang_conf)
 from spyder.preferences.configdialog import GeneralConfigPage
 from spyder.py3compat import to_text_string
 import spyder.utils.icon_manager as ima
 from spyder.utils.qthelpers import (register_app_launchservices,
                                     restore_launchservices)
 
+# To open files from Finder directly in Spyder.
+if sys.platform == "darwin":
+    import applaunchservices as als
+
 
 HDPI_QT_PAGE = "https://doc.qt.io/qt-5/highdpi.html"
 
@@ -46,7 +48,12 @@ def setup_page(self):
         # --- Interface
         general_group = QGroupBox(_("General"))
 
-        languages = LANGUAGE_CODES.items()
+        # Remove disabled languages
+        language_codes = LANGUAGE_CODES.copy()
+        for lang in DISABLED_LANGUAGES:
+            language_codes.pop(lang)
+
+        languages = language_codes.items()
         language_choices = sorted([(val, key) for key, val in languages])
         language_combo = self.create_combobox(_('Language:'),
                                               language_choices,


Test patch: