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

ABP CLI translate command #4072

Closed
hikalkan opened this issue May 23, 2020 · 2 comments · Fixed by #4088
Closed

ABP CLI translate command #4072

hikalkan opened this issue May 23, 2020 · 2 comments · Fixed by #4088

Comments

@hikalkan
Copy link
Member

hikalkan commented May 23, 2020

Mainly used to translate ABP's resources (JSON files) easier.

Crteate the unified file

Create a unified file that contains all texts of all JSON files to be translated for the specified culture:

abp translate --culture|-c <culture> [---output|-o <file-name: abp-translation.json>] [--reference-culture|-r <culture: en>] [--all-values|-a]
  • It searches for all JSON files inside the current folder and all subdirectories recursively (should ignore some folders like node_modules), finds the language files. May check the file content format to understand if it is a language translation file.
  • It includes only the missing texts by default. --all-values is used to include all (maybe the translating person wants to review existing texts too)

The output file format:

{
  "referenceCulture": "en",
  "culture": "es",
  "resources": {
    "AbpUi": {
      "targetFolder": "framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/",
      "texts": {
        "InternalServerErrorMessage": {
          "reference": "An internal error occurred during your request!",
          "value": ""
        }
      }
    }
  }
}
  • Just like the AbpUi, we can add other resources too.

Apply changes

Applies changes to the related files:

abp translate --apply|-a [--file|-f <file-name: abp-translation.json>]
  • It creates or updates the file for the translated culture.
  • Then user can review the changes and send a pull request.
  • Also ignore abp-translation.json file on .gitignore for the abp repository (to not add to GitHub by mistake).

Update the documentation

@hikalkan hikalkan added this to the backlog milestone May 23, 2020
@hikalkan hikalkan modified the milestones: backlog, 2.9 May 24, 2020
@hikalkan hikalkan changed the title Create a tool to make it easier to contribute to localization ABP CLI translate command May 24, 2020
maliming added a commit that referenced this issue May 25, 2020
@hikalkan
Copy link
Member Author

See how to use before release, in the dev branch of the abp repository: #4088 (comment)

@hikalkan
Copy link
Member Author

hikalkan commented Jun 5, 2020

See the documentation to learn how to use the abp translate command: https://docs.abp.io/en/abp/latest/CLI#translate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants