Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Take language code from filename instead of .yml files #10

Merged
merged 1 commit into from Nov 18, 2022

Conversation

Pure-Peace
Copy link
Contributor

Before

en: # The language code of this mapping file
  hello: Hello world # A simple key -> value mapping
  messages:
    hello: Hello, %{name} # A nested key.sub_key -> value mapping, in this case "messages.hello" maps to "Hello, %{name}"

After that, there is no need to add a first-level language code to the .yml file

hello: Hello world # A simple key -> value mapping
messages:
  hello: Hello, %{name} # A nested key.sub_key -> value mapping, in this case "messages.hello" maps to "Hello, %{name}"

This modification makes the locales .yml file more standardized, and some vscode plugins can be used directly, such as i18n-ally

.vscode/i18n-ally-custom-framework.yml

languageIds:
  - rust

usageMatchRegex:
  - "[^\\w\\d]t!\\(['\"]({key})['\"]"

monopoly: true

Work for rust now!

@huacnlee huacnlee merged commit d5ae58f into longbridgeapp:main Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants