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
{{ message }}
This repository has been archived by the owner on Nov 24, 2020. It is now read-only.
and it would generate a function to get the value for that translation given the phone Locale, and using the default value if the Locale trasnlation is not avaiable
The text was updated successfully, but these errors were encountered:
Perhaps all languages could go into external files (i.e. have no default language)? And that external file be just a import with some sdkgen syntax for describing it (maybe similar to @tironiigor's?)
A proposal:
Create a construct to define translatable strings:
i18n en, en-US, default {
female = "Female"
placeNotFound = "The place was not found"
}
i18n pt-BR {
female = "Femino"
placeNotFound = "Local não encontrado"
}
Then this translation can be used in places where a string could be used, optionally. This is a mix of @tironiigor and @dygufa:
type Gender enum {
female: i18n.female // I can refer to i18n constants
male: "Masculino" // Or simply use a plain string
}
similarly those constants would be usable when implementing the api:
if (!place) {
throw api.err.NotFound(ctx.i18n.placeNotFound);
}
It would be a feature so we could have an enum like
and then we could have
and it would generate a function to get the value for that translation given the phone Locale, and using the default value if the Locale trasnlation is not avaiable
The text was updated successfully, but these errors were encountered: