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

feat(localize): support Application Resource Bundle (ARB) translation file format #36795

Closed

Conversation

petebacondarwin
Copy link
Member

@petebacondarwin petebacondarwin commented Apr 24, 2020

The ARB format is a JSON file containing an object where the keys are the
message ids and the values are the translations.

It is extensible because it can also contain metadata about each message.

For example:

{
  "@@locale": "...",
  "message-id": "Translated message string",
  "@message-id": {
    "type": "text",
    "description": "Some description text",
    "x-location": { "start": {"line": 23, "column": 145}, "file": "some/file.ts" }
  },
}

For more information, see:
https://github.com/google/app-resource-bundle/wiki/ApplicationResourceBundleSpecification

@petebacondarwin petebacondarwin added feature Issue that requests a new feature action: review The PR is still awaiting reviews from at least one requested reviewer area: i18n target: major This PR is targeted for the next major release comp: ivy labels Apr 24, 2020
@ngbot ngbot bot modified the milestone: needsTriage Apr 24, 2020
@pullapprove pullapprove bot requested a review from mhevery April 24, 2020 14:48
@AndrewKushnir AndrewKushnir requested review from IgorMinar and removed request for mhevery April 24, 2020 19:59
Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding ARB format @petebacondarwin 👍

I left a couple comments, could you please have a look when you get a chance?

Quick question: we add support for bundles that contain translated content, should we also introduce ARB support for extracted messages (for Ivy only)?

Adding ARB format makes sense to me, but since it's a new feature that extends the list of supported formats, it'd be great to get @IgorMinar's approval as well (added Igor as a reviewer).

Thank you.

@petebacondarwin
Copy link
Member Author

Quick question: we add support for bundles that contain translated content, should we also introduce ARB support for extracted messages (for Ivy only)?

My aim is to include an ARB serializer in the new extractor.

@petebacondarwin petebacondarwin added target: minor This PR is targeted for the next minor release and removed target: major This PR is targeted for the next major release labels Sep 28, 2020
@petebacondarwin petebacondarwin marked this pull request as draft September 28, 2020 11:46
@petebacondarwin petebacondarwin added state: WIP and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Sep 28, 2020
@petebacondarwin petebacondarwin added action: review The PR is still awaiting reviews from at least one requested reviewer and removed state: WIP state: blocked labels Nov 24, 2020
@petebacondarwin petebacondarwin marked this pull request as ready for review November 24, 2020 21:27
Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @petebacondarwin 👍

… file format

The ARB format is a JSON file containing an object where the keys are the
message ids and the values are the translations.

It is extensible because it can also contain metadata about each message.

For example:

```
{
  "@@Locale": "...",
  "message-id": "Translated message string",
  "@message-id": {
    "type": "text",
    "description": "Some description text",
    "x-locations": [{ "start": {"line": 23, "column": 145}, "file": "some/file.ts" }]
  },
}
```

For more information, see:
https://github.com/google/app-resource-bundle/wiki/ApplicationResourceBundleSpecification
@petebacondarwin petebacondarwin removed the request for review from IgorMinar November 25, 2020 16:55
@petebacondarwin petebacondarwin added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Nov 25, 2020
@jessicajaniuk jessicajaniuk added action: review The PR is still awaiting reviews from at least one requested reviewer and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Nov 25, 2020
@petebacondarwin petebacondarwin deleted the i18n-arb-support branch November 25, 2020 19:19
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: i18n cla: yes feature Issue that requests a new feature target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants