Giter Club home page Giter Club logo

Comments (6)

xavierraffin avatar xavierraffin commented on July 28, 2024

In aws-amplify/amplify-js#4979 Eric explained why he did not do translation at that time in his PR. Maybe now is time to finish the job?

from amplify-ui.

harrysolovay avatar harrysolovay commented on July 28, 2024

Is this the list of possible translations which you would like better-documented?

from amplify-ui.

xavierraffin avatar xavierraffin commented on July 28, 2024

I am not sure for that one.
The initial ask was about the i18n translation provided off the shelf by Amplify before new components: https://github.com/aws-amplify/amplify-js/blob/master/packages/aws-amplify-react/src/AmplifyI18n.tsx

And the second ask is a translation of the error from Cognito.
For that I understand that having an error code from Cognito is something that will help. I already talk about that to ouli@ (AWS login) and they have plan to do that in the future

from amplify-ui.

Immutible avatar Immutible commented on July 28, 2024

I'm facing similar issues with translations. A complete list wouldn't be enough for covering all the cases because the error messages can also include input values. E.g.

2 validation errors detected: Value 'test test' at 'userName' failed to satisfy constraint: Member must satisfy regular expression pattern: [\p{L}\p{M}\p{S}\p{N}\p{P}]+; Value 'test test' at 'userAlias' failed to satisfy constraint: Member must satisfy regular expression pattern: [\p{L}\p{M}\p{S}\p{N}\p{P}]+

In above case email is used as a userName value.

from amplify-ui.

eddiekeller avatar eddiekeller commented on July 28, 2024

This remains an issue, even in the new version of the authenticator. Cognito error messages do not get translated. Since user input is often included in the message, I'm guessing what we would have to hook in to is the error type. Off the top of my head, I'm not sure if Cognito reuses error types, though. If they do, then that would not be a reliable solution.

from amplify-ui.

ericclemmons avatar ericclemmons commented on July 28, 2024

This is also a short-coming of I18n being little more than a map.

Previous implementations relied on pattern-matching to translate errors:

https://github.com/aws-amplify/amplify-js/blob/853adc7554f0a61922e3348d3626c73a5166266d/packages/aws-amplify-react/src/AmplifyMessageMap.tsx

from amplify-ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.