Rename translation dicts to plural form

This is more in line with the rest of the code.

Contributes to issue CURA-844.
This commit is contained in:
Ghostkeeper 2016-07-05 09:54:39 +02:00
parent 19b4ec655e
commit 1b0974ba9f

View file

@ -10,19 +10,19 @@ from . import Preferences #To upgrade preferences.
from . import Profile # To upgrade profiles. from . import Profile # To upgrade profiles.
## How to translate printer names from the old version to the new. ## How to translate printer names from the old version to the new.
_printer_translation = { _printer_translations = {
"ultimaker2plus": "ultimaker2_plus" "ultimaker2plus": "ultimaker2_plus"
} }
## How to translate profile names from the old version to the new. ## How to translate profile names from the old version to the new.
_profile_translation = { _profile_translations = {
"PLA": "generic_pla", "PLA": "generic_pla",
"ABS": "generic_abs", "ABS": "generic_abs",
"CPE": "generic_cpe" "CPE": "generic_cpe"
} }
## How to translate setting names from the old version to the new. ## How to translate setting names from the old version to the new.
_setting_name_translation = { _setting_name_translations = {
"remove_overlapping_walls_0_enabled": "travel_compensate_overlapping_walls_0_enabled", "remove_overlapping_walls_0_enabled": "travel_compensate_overlapping_walls_0_enabled",
"remove_overlapping_walls_enabled": "travel_compensate_overlapping_walls_enabled", "remove_overlapping_walls_enabled": "travel_compensate_overlapping_walls_enabled",
"remove_overlapping_walls_x_enabled": "travel_compensate_overlapping_walls_x_enabled", "remove_overlapping_walls_x_enabled": "travel_compensate_overlapping_walls_x_enabled",
@ -32,7 +32,7 @@ _setting_name_translation = {
## How to translate variants of specific machines from the old version to the ## How to translate variants of specific machines from the old version to the
# new. # new.
_variant_translation = { _variant_translations = {
"ultimaker2_plus": { "ultimaker2_plus": {
"0.25 mm": "ultimaker2_plus_0.25", "0.25 mm": "ultimaker2_plus_0.25",
"0.4 mm": "ultimaker2_plus_0.4", "0.4 mm": "ultimaker2_plus_0.4",
@ -103,8 +103,8 @@ class VersionUpgrade21to22(VersionUpgrade):
# \return The name of the corresponding printer in Cura 2.2. # \return The name of the corresponding printer in Cura 2.2.
@staticmethod @staticmethod
def translatePrinter(printer): def translatePrinter(printer):
if printer in _printer_translation: if printer in _printer_translations:
return _printer_translation[printer] return _printer_translations[printer]
return printer #Doesn't need to be translated. return printer #Doesn't need to be translated.
## Translates a built-in profile name that might have changed since the ## Translates a built-in profile name that might have changed since the
@ -114,8 +114,8 @@ class VersionUpgrade21to22(VersionUpgrade):
# \return The corresponding profile name in the new version. # \return The corresponding profile name in the new version.
@staticmethod @staticmethod
def translateProfile(profile): def translateProfile(profile):
if profile in _profile_translation: if profile in _profile_translations:
return _profile_translation[profile] return _profile_translations[profile]
return profile #Doesn't need to be translated. return profile #Doesn't need to be translated.
## Updates settings for the change from Cura 2.1 to 2.2. ## Updates settings for the change from Cura 2.1 to 2.2.
@ -156,8 +156,8 @@ class VersionUpgrade21to22(VersionUpgrade):
# \return The name of the corresponding setting in Cura 2.2. # \return The name of the corresponding setting in Cura 2.2.
@staticmethod @staticmethod
def translateSettingName(setting): def translateSettingName(setting):
if setting in _setting_name_translation: if setting in _setting_name_translations:
return _setting_name_translation[setting] return _setting_name_translations[setting]
return setting #Doesn't need to be translated. return setting #Doesn't need to be translated.
## Translates a variant name for the change from Cura 2.1 to 2.2 ## Translates a variant name for the change from Cura 2.1 to 2.2
@ -168,6 +168,6 @@ class VersionUpgrade21to22(VersionUpgrade):
# \return The name of the corresponding variant in Cura 2.2. # \return The name of the corresponding variant in Cura 2.2.
@staticmethod @staticmethod
def translateVariant(variant, machine): def translateVariant(variant, machine):
if machine in _variant_translation and variant in _variant_translation[machine]: if machine in _variant_translations and variant in _variant_translations[machine]:
return _variant_translation[machine][variant] return _variant_translations[machine][variant]
return variant return variant