Skip to content

Commit

Permalink
Fix i18n tree shaking when using ymlConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
maggie44 committed Feb 1, 2023
1 parent b7430aa commit 1ef9177
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 20 deletions.
18 changes: 9 additions & 9 deletions config_default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pages:
# 1:
# components: [SystemEnvConfig]
# icon: settings # The label from Google Material Icons to display in the sidebar: https://fonts.google.com/icons
# label: components.system.device_info.environment_variables # The i18n key from ui/src/i18n/en-US.json to use as sidebar text
# label: yml_config.environment_variables # The i18n key from ui/src/i18n/en-US.json to use as sidebar text. Only use yml_config. keys!
# ----------------------------------------------------------------------------------------------------
#
# All the other sections are removed so you only see the environment variable configuration
Expand All @@ -25,46 +25,46 @@ pages:
components: [SystemDeviceInfo]
# Path will always be '/'
icon: visibility
label: system.menu_items.device_info
label: yml_config.device_info
FileManager:
frames:
1:
components: [ToolsFileManager]
path: filemanager
icon: folder
label: system.menu_items.file_manager
label: yml_config.file_manager
Configuration:
frames:
1:
components: [SystemChangeHostname]
title: components.system.device_info.network_config
title: yml_config.network_config
2:
components: [SystemEnvConfig]
title: components.system.device_info.environment_variables
title: yml_config.environment_variables
path: configuration
icon: settings
label: system.menu_items.configuration
label: yml_config.configuration
ContainerManager:
frames:
1:
components: [ToolsContainerManager]
path: containermanager
icon: all_inbox
label: system.menu_items.container_manager
label: yml_config.container_manager
Networking:
frames:
1:
components: [WifiConnect]
path: networking
icon: router
label: system.menu_items.networking
label: yml_config.networking
SystemInfo:
frames:
1:
components: [SystemJournalDLogs, ToolsSystemInfo]
path: systeminfo
icon: info
label: system.menu_items.system_info
label: yml_config.system_info
styles:
header:
visible: true # Whether the header logo should be visible
Expand Down
2 changes: 1 addition & 1 deletion ui/.eslintrc-treeshake.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.exports = {
{
src: './src',
extensions: ['.js', '.vue', '.ts'],
ignores: ['/system.menu_items/'],
ignores: ['/yml_config/'],
enableFix: true
}
]
Expand Down
9 changes: 9 additions & 0 deletions ui/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,15 @@ module.exports = {
'import/prefer-default-export': 'off',

// i18n rules
'@intlify/vue-i18n/no-unused-keys': [
'error',
{
src: './src',
extensions: ['.js', '.vue', '.ts'],
ignores: ['/yml_config/'],
enableFix: false
}
],
'@intlify/vue-i18n/no-missing-keys': 'error',
'@intlify/vue-i18n/no-dynamic-keys': 'error',
'@intlify/vue-i18n/no-duplicate-keys-in-locale': 'error',
Expand Down
20 changes: 10 additions & 10 deletions ui/src/i18n/en-US.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
{
"yml_config": {
"configuration": "Configuration",
"container_manager": "Container Manager",
"device_info": "Device Info",
"environment_variables": "Environment Variables",
"file_manager": "File Manager",
"network_config": "Network Configuration",
"networking": "Networking",
"system_info": "System Info"
},
"title": "Balena Starter Interface",
"general": {
"are_you_sure": "Are you sure?",
Expand Down Expand Up @@ -47,11 +57,9 @@
"system": {
"device_info": {
"are_you_connected_fleet": "Are you connected to a fleet?",
"environment_variables": "Environment Variables",
"ip_address": "IP Address",
"location": "Location",
"mac_address": "MAC Address",
"network_config": "Network Configuration",
"not_undervolted": "Normal Power",
"os_version": "OS Version",
"public_ip": "Public IP",
Expand Down Expand Up @@ -159,14 +167,6 @@
"wrong_way": "Wrong way…",
"no_backend": "Unable to communicate with the backend service"
},
"menu_items": {
"configuration": "Configuration",
"container_manager": "Container Manager",
"device_info": "Device Info",
"networking": "Networking",
"system_info": "System Info",
"file_manager": "File Manager"
},
"network": {
"network_connection_down": "You are no longer connected to a network. Try reconnecting to your device.",
"network_connection_restored": "Network connection restored.",
Expand Down

0 comments on commit 1ef9177

Please sign in to comment.