You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a single project in vscode that uses AWS Amplify. The front-end is React and i18n-ally works fine. However, I have localizable strings in the supporting Lambdas that are in the same project (Amplify puts the back-end services in the same directory hierarchy). In both the root src/locales and the amplify/backend/function/myFunction/src/locales directory, there are localization files for the front-end (src/locales) and separate ones for the backend (amplify/backend/myFunction/src/locales). My i18n-ally.localesPaths is set to ["src/locales", "amplify/backend/function/*/src/locales"] - which I thought would pick up the locales when I click on a file in either subproject. e.g. If I click on App.js in the src/ directory, it does show the Keys in use, # not translated, etc. However, if I click on the amplify/backend/myFunction/src/index.js file, it says the key does not exist, e.g.
en: i18n key "manageEmailPrefsHtml" does not exist
However, that key is in the /amplify/backend/myFunction/src/locales/en.json
It appears that i18n-ally is saying they keys do not exist in the main src/locales directory - which they do not, because they are for the Lambda. If I choose translate on them, i18n-ally puts the keys in the src/locales directory not the Lambda's directory. Does someone have a configuration that works for AWS Amplify projects using i18n-ally for both front-end and back-end translations while working in a single project? If I use vscode and open the folder amplify/backend/function/myFunction/ and add the supported framework of i18next, then i18n-ally works correctly for the Lambda. However, I have to keep switching back and forth between the 2 different projects - which is a bit cumbersome, as I have 20 Lambdas with translations...My guess is the localesPath is just saying you can have multiple directories for your different locales files, but they are bound to the 'main' project.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a single project in vscode that uses AWS Amplify. The front-end is React and i18n-ally works fine. However, I have localizable strings in the supporting Lambdas that are in the same project (Amplify puts the back-end services in the same directory hierarchy). In both the root src/locales and the amplify/backend/function/myFunction/src/locales directory, there are localization files for the front-end (src/locales) and separate ones for the backend (amplify/backend/myFunction/src/locales). My i18n-ally.localesPaths is set to ["src/locales", "amplify/backend/function/*/src/locales"] - which I thought would pick up the locales when I click on a file in either subproject. e.g. If I click on App.js in the src/ directory, it does show the Keys in use, # not translated, etc. However, if I click on the amplify/backend/myFunction/src/index.js file, it says the key does not exist, e.g.
en: i18n key "manageEmailPrefsHtml" does not exist
However, that key is in the /amplify/backend/myFunction/src/locales/en.json
It appears that i18n-ally is saying they keys do not exist in the main src/locales directory - which they do not, because they are for the Lambda. If I choose translate on them, i18n-ally puts the keys in the src/locales directory not the Lambda's directory. Does someone have a configuration that works for AWS Amplify projects using i18n-ally for both front-end and back-end translations while working in a single project? If I use vscode and open the folder amplify/backend/function/myFunction/ and add the supported framework of i18next, then i18n-ally works correctly for the Lambda. However, I have to keep switching back and forth between the 2 different projects - which is a bit cumbersome, as I have 20 Lambdas with translations...My guess is the localesPath is just saying you can have multiple directories for your different locales files, but they are bound to the 'main' project.
Beta Was this translation helpful? Give feedback.
All reactions