commit: c58ed1036fd3bdbfb13f5dbc92e887acc97c5e64
parent d31da2c3009c49eb8f55ff03ad622f0be4f4bf6c
Author: Henry Jameson <me@hjkos.com>
Date: Sun, 6 Oct 2024 03:30:52 +0300
remove i18n stuff.
first of all - it's too much work for me AND for translators
second of all - providing support would be a living hell nightmare
trying to understand what component it is in users's language that isn't english
Diffstat:
3 files changed, 4 insertions(+), 70 deletions(-)
diff --git a/src/components/settings_modal/tabs/style_tab/style_tab.js b/src/components/settings_modal/tabs/style_tab/style_tab.js
@@ -136,29 +136,6 @@ export default {
cOrange: '#ffa500'
})
- // ### I18n stuff
- // The paths in i18n are getting ridicously long, this effectively shortens them
- const getI18nPath = (componentName) => `settings.style.themes3.editor.components.${componentName}`
- // vue i18n doesn't seem to have (working) mechanic to have a fallback so we have to
- // make do ourselves
- const fallbackI18n = (translated, fallback) => {
- if (translated.startsWith('settings.style.themes3')) {
- return fallback
- }
- return translated
- }
- const getFriendlyNamePath = (componentName) => getI18nPath(componentName) + '.friendlyName'
- const getVariantPath = (componentName, variant) => {
- return variant === 'normal'
- ? 'settings.style.themes3.editor.components.normal.variant'
- : `${getI18nPath(componentName)}.variants.${variant}`
- }
- const getStatePath = (componentName, state) => {
- return state === 'normal'
- ? 'settings.style.themes3.editor.components.normal.state'
- : `${getI18nPath(componentName)}.states.${state}`
- }
-
// ### Initialization stuff
// Getting existing components
const componentsContext = require.context('src', true, /\.style.js(on)?$/)
@@ -569,10 +546,6 @@ export default {
previewCss,
previewClass,
editorHintStyle,
- getFriendlyNamePath,
- fallbackI18n,
- getVariantPath,
- getStatePath,
componentHas,
isShadowTabOpen,
onTabSwitch,
diff --git a/src/components/settings_modal/tabs/style_tab/style_tab.vue b/src/components/settings_modal/tabs/style_tab/style_tab.vue
@@ -71,7 +71,7 @@
:key="'component-' + key"
:value="key"
>
- {{ fallbackI18n($t(getFriendlyNamePath(componentsMap.get(key).name)), componentsMap.get(key).name) }}
+ {{ componentsMap.get(key).name }}
</option>
</Select>
</div>
@@ -90,7 +90,7 @@
:key="'component-variant-' + variant"
:value="variant"
>
- {{ fallbackI18n($t(getVariantPath(selectedComponentName, variant)), variant) }}
+ {{ variant }}
</option>
</Select>
</div>
@@ -112,7 +112,7 @@
:value="selectedState.has(state)"
@update:modelValue="(v) => updateSelectedStates(state, v)"
>
- {{ fallbackI18n($t(getStatePath(selectedComponentName, state)), state) }}
+ {{ state }}
</Checkbox>
</li>
</ul>
diff --git a/src/i18n/en.json b/src/i18n/en.json
@@ -800,46 +800,7 @@
"no-auto": "Disabled"
},
"component_tab": "Components style",
- "palette_tab": "Color presets",
- "components": {
- "normal": {
- "state": "Normal",
- "variant": "Default"
- },
- "Alert": {
- "friendlyName": "Alert",
- "variants": {
- "error": "Error",
- "warning": "Warning",
- "success": "Success"
- }
- },
- "Button": {
- "friendlyName": "Button",
- "variants": {
- "danger": "Dangerous"
- },
- "states": {
- "toggled": "Toggled",
- "pressed": "Pressed",
- "hover": "Hovered",
- "focused": "Has focus",
- "disabled": "Disabled"
- }
- },
- "Input": {
- "friendlyName": "Input fields",
- "variants": {
- "checkbox": "Checkbox",
- "radio": "Radio"
- },
- "states": {
- "hover": "Hovered",
- "focus": "Focused",
- "disabled": "Disabled"
- }
- }
- }
+ "palette_tab": "Color presets"
},
"hacks": {
"underlay_overrides": "Change underlay",