-
Notifications
You must be signed in to change notification settings - Fork 39
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: update localization doc #1784
Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit c7e3925. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
docs/localization/LOCALIZATION.md
Outdated
|
||
- Place your translation bundles either at your dedicated endpoint URL or inside your application's folder **src/assets/assets-otter/i18n**. The format of the bundles is a simple key/value pair object where key is the resource name and value its translation. The key naming convention is component selector followed by `.` (dot character) and any string of your choice. | ||
It's always a good idea to respect certain naming conventions. For components, we prefix each key by the component selector to ensure the uniqueness of cross-components keys. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's always a good idea to respect certain naming conventions. For components, we prefix each key by the component selector to ensure the uniqueness of cross-components keys. | |
It's always a good idea to respect certain naming conventions. For components, we recommend to prefix each key by the component selector to ensure the uniqueness of cross-components keys. |
maybe we can create a linter for that :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I will create an issue for this once the PR is merged
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs/localization/LOCALIZATION.md
Outdated
|
||
- Fallback language. In case some resource key does not exist in language X, the loader tries to fetch translation bundle from the endpoint location in fallback language Y in the first place and ends by loading json bundles from the application (root of dist folder **/** by default) if previous steps have failed (bundles output path in dist folder is also configurable via a shell option). | ||
- Translations loader using a specific endpoint (external URL source such as a CMS for example) or defaulting to local translation bundles in the **src/assets/assets-otter/i18n** folder of your application. The input folder for bundles can be changed by configuration (via a shell option). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which shell option ? (not sure to know what it is)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed to CLI option to be more clear (The assets folder for bundles can be changed by configuration (via a CLI option).
), but I could remove this line if you don't find it necessary.
|
||
```typescript | ||
You may also need to set up your http server to accept **CORS** and update the `connect-src` property of `csp.json` in your application. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need to add that in our documentation ?
It's not related to Otter no ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not related to Otter but it could be useful during the setup of the localization.
What does everyone think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's good to add it if it helps the setup
You may also need
-> it is not clear in the doc when and why this would be needed
c86d582
to
da302a9
Compare
"defaultValue": "This is my default value 2" | ||
}, | ||
"o3r-my-component-pres.someglobalkey1": { | ||
"$ref": "../global.localization.json#/someglobalkey1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we are missing documentation to explain the purpose of using $ref
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a line above this code snippet to explain why we can use $ref
, should we add additional documentation?
``` | ||
|
||
### How to add RTL support in my app | ||
|
||
The **TextDirectionService** has to be injected in `app.component.ts` as follows. | ||
The `TextDirectionService` has to be injected in `app.component.ts` as follows: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be discussed with the team how we can move it outside the app.component to not pollute it
3fcb96f
to
04a4639
Compare
Proposed change
Update documentation on localization