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

I18n: Allow grouping labels in vocabulary #5079

Closed
MattiaCostamagna opened this issue Mar 12, 2020 · 2 comments
Closed

I18n: Allow grouping labels in vocabulary #5079

MattiaCostamagna opened this issue Mar 12, 2020 · 2 comments
Labels
feature-request Request a new feature UI Related to UI Components

Comments

@MattiaCostamagna
Copy link

I think it would be useful to have the possibility of grouping the labels in the vocabulary in order to keep them organized.
Here's an example:

const dict = {
    en: {
        login: {
			email: 'E-mail address',
			passw: 'Password',
			submit: 'Sign in'
		},
		signup: {
			email: 'E-mail address',
			name: 'Your name',
			submit: 'Sign up'
		}
    },
    it: {
        login: {
			email: 'Indirizzo e-mail',
			passw: 'Password',
			submit: 'Accedi'
		},
		signup: {
			email: 'Indirizzo e-mail',
			name: 'Il tuo nome',
			submit: 'Registrati'
		}
    }
};

I18n.putVocabularies(dict);

Retrieving the labels could be done by calling the get function in the following way:

I18n.get('login.submit');
// or
I18n.getAll().login.submit;
// or
I18n.labels.login.submit;

I know this might result in duplicate labels (as the email field in the example above), but as I said before it'd definitely help keeping them organized.

Thank you

@MattiaCostamagna MattiaCostamagna added the feature-request Request a new feature label Mar 12, 2020
@ashika01 ashika01 added the UI Related to UI Components label Mar 12, 2020
@ashika01
Copy link
Contributor

@MattiaCostamagna : Hi, thanks for opening this feature request. Like you mentioned we may end up having duplications.

We are working our new UI system now. You can read more about this #3279 (#3279). We have basic i18n setup of transalation constants here - https://github.com/aws-amplify/amplify-js/blob/ui-components/master/packages/amplify-ui-components/src/common/Translations.ts

And probably split translations as we add more categories. Look for more updates on the RFC as we go forward.

@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request a new feature UI Related to UI Components
Projects
None yet
Development

No branches or pull requests

2 participants