deploy page-object data and pattern files
NOT FOR PRODUCTION USE -ALPHA QUALITY
It deploys page-object data and pattern files. This is most useful for web applications using locale and language specific data.
For example, your application may use locale files to render an input for a social-security-number. Locale files would describe the input for 'en-US', but not for 'es-ES', while language files would describe a label for the input, such as 'ssn number:' or 'ssn numero:'.
Page-deploy strategically organizes these files for deployment. This positively affects the way you test, deploy, translate and develop an application using such files.
Any file-deployment tool relies on input files being organised in some way. I have worked on applications built around poorly organised input files. I have studied the organisation of International files by Ruby on Rails, Django, Microsoft, Jquery, Mozilla, Apple and by the Unicode Consortium. This tool is a product of that experience.
Decisions made by this software:
- JSON as the primary data format.
- Join files around subjects they describe.
- Separate locale files from language files.
- Separate descriptive rules from data definitions.
- Separate files from any subject platform or codebase.
- Define data in two ways only: element, array of elements.
- No Config File
Web applications require some control over the number of requests needed to obtain data and the size of that data. To allow control, some data should be available as both an element and an array of elements. One source only should exist for that data.
getStarted is provided with page-deploy. Its layout and file-naming scheme are supported. A full layout of the directory with the
$ tree -L 10 ./getStarted/convert...
The example shows files grouped by 'defaults', 'data' and 'page-object'. Another* grouping could be used. The grouping used in the example is recommended.
Ruby on Rails groups data by 'models' and 'views'.
ISO 639-2 represents all languages contained in ISO 639-1 and in addition any other language as well as language groups as they may be coded for special purposes [...] every language code in the two-letter code set has a corresponding language code in the alpha-3 list, but not necessarily vice versa.
Examples also use naming conventions copied from Apple. 'ES' designates the locale of Spain and 'spa-ES' designates Spanish language used in Spain. 'spa-ES_CL' designates spanish language of Spain, for the Chilean locale.
Fewer files are needed when an application supports these scenarios:
Lang data is same for each locale, but is different by language
A group of categories, such as 'food' and 'health'. One data is defined for all locales -with translations.categories/baseLang.jsoncategories/eng-US.jsoncategories/spa-ES.jsoncategories/spa-CL.json
Locale data differs for each locale, but is one language for each
A legal document, such as a 'user agreement'. Specific data for each locale is defined -no translations.terms-and-conditions/baseLocale.jsonterms-and-conditions/US.jsonterms-and-conditions/ES.jsonterms-and-conditions/CL.json
LangLocale data differs for each locale and language
A list of banks, sub-regions (prefectures or states) or payment gateways. Specific data for each locale is defined -with translations.municipalities/baseLangLocaleArr.jsonmunicipalities/eng-US_USArr.jsonmunicipalities/eng-US_ESArr.jsonmunicipalities/eng-US_CLArr.jsonmunicipalities/spa-ES_USArr.jsonmunicipalities/spa-ES_ESArr.jsonmunicipalities/spa-ES_CLArr.jsonmunicipalities/spa-CL_USArr.jsonmunicipalities/spa-CL_ESArr.jsonmunicipalities/spa-CL_CLArr.json
A data might differ only by 'lang' or 'locale'. If your application supports 3 locales and 3 languages does this data need to exist in 9 files or 3?
Reference smaller files from another file -page-deploy will build that new file for you.
properties file and special values...
Use local paths to support files such as images. page-deploy will update the paths to web accessible ones.