-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Refactor translations file to match model setup #547
Comments
@billybonks I think I'm in favor of this, but I think we should maybe make the prefixing a little clearer. models: {
patient: {
firstName: 'First Name',
lastName: 'Last Name'
},
inventory: {
name: 'Name',
quantity: 'Quantity'
}
} The other thing to keep in mind is will it make sense for translators who aren't developers? |
So i am up for your prefixing, if we agree, that the models won't share strings for their attributes. like |
@billybonks I absolutely agree we shouldn't share strings for attributes. Reusability is great for programming, but not so great for translations because context matters. |
@jkleinsc i updated the issue description based on https://gist.github.com/billybonks/925a37e70dcde840a4205d065ea937e7 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
In order to have scalable, maintainable and clean translation files we should, model them according to their data models.
This means:
Every model should have it's name translated in singular and plural,
Every attribute should have a translation 1 to 1 relationship.
Model names could share the same namespace as attributes, but that could cause conflicts, so we would rather keep them seperate.
Take the following application models:
The resultant translation file would look as follows:
The text was updated successfully, but these errors were encountered: