Schwifty i18n
A Schwifty i18n plugin
Lead Maintainer: Daniel Cole
THIS IS A WORK IN PROGRESS
Usage
Create a Schwifty model as per usual:
const Model = Model;const Joi = ;const SchwiftyI18n = ; static { return 'Category'; } static { return Joiobject id : Joi title: Joi ; } moduleexports = ;
You will need to manually add the migrations, as an example:
knexschema; knexschema;
To add translations to a model (the model has to have been created previously with the defaultLocale
):
const category = id: 1 name: 'Une catégorie' ; await Category;
To delete a translation (you can't delete the defaultLocale
, to do this you must delete the model):
await Category;
To fetch a specific language:
await Category; await Category;