Files
raven/devdocs/specs/core-localization.txt
2018-11-15 21:49:33 +00:00

106 lines
6.1 KiB
Plaintext

# Localization specifications
REQUIREMENTS
- Client does *ALL* localization locally, only exception is the server ops logs
- This saves bandwidth and hassle and leaves presentation to the client where it belongs (was a source of trouble in v7)
- Keys are text, human readable and as short as possible
- Not numeric ID's for these, strictly textual
- values may have substitution tokens in them for certain things
- DataDump plugin will export and import any custom locales that did not come with AyaNova 7
- Dump needs to check if the "stock" locale has been edited or not before exporting
- Only edited ones are exported
- For example if someone edited the Spanish locale then it would dump as "Spanish-Custom" (or whatever the word for custom is in that language) so as not to interfere with our stock Built in Spanish in Raven
- The documented renaming (below) will need to be automated during import of v7 stock locales to migrate to the new key values
- Two kinds of locales: Stock and Custom.
- Stock locales are stored in db and not user editable
- STock locale names are whatever the international name for that locale is like "esp" or "fr" etc
- Custom locales are stored in the database and are user customizable
ROUTES
- GET ROUTE that provides a pick list of locales
- GET ROUTE that returns all key value pairs when requested for a specific locale
- This one is for editing purposes or for export to disk
- GET ROUTE that returns a list of specific key value pairs for a requested locale and specific list of locale keys provided
- This one is for day to day ops and will be called on any client opening a new area of UI they have not previously opened
- PUT ROUTE that accepts a list of key value pairs and a specific locale and updates the current values in db from the provided list
- if locale name key provided is one of our stock ones then it errors out as you can't change the stock locales
- if locale doesn't exist in db errors out
- biz full rights only
- POST ROUTE that creates a new locale duplicated from an existing locale and copies all the values from the existing locale
- Post object {sourceLocale:"English", newLocale:"MyLocale"}
- Errors if already exists with that name
- Sets it to stock=false so it can be edited
- This is also how you rename a locale
- DELETE ROUTE for deleting any non-stock locale
- Can't delete current DB default locale (specfic error)
- Users of that locale will be reset to current DB default locale
CHANGES MADE TO KEYS FROM v7
- Replaced all [.Label.] with [.]
- Replaced all ["O.] with ["] this needs to be a case sensitive change!!!
- Removed duplicate key [WorkorderService.CloseByDate] that resulted from last change of O. (the first one between workorderservice and workorderstatus)
- Replaced all [.ToolBar.] with [.]
- Replaced all [.Toolbar.] with [.]
- Replaced all [.Go.] with [.]
- Replaced all [.Command.] with [.]
- Removed duplicate key created by last operation: [UI.Search] (removed second longer one that refers to database)
- Replaced all [.Error.] with [.]
- Replaced all [.Object.] with [.]
- Replaced all ["UI.] with ["] (and removed exact dupe keys created as a result)
- Replaced all [.] with []
- Removed dupe WorkorderItemOutsideService (removed the one with the longest value)
- Replaced all ["AddressAddress"] with ["Address"]
- Replaced all ["ContactPhoneContactPhone"] with ["ContactPhone"]
- Replaced all ["ContactPhonePhone"] with ["ContactPhone"]
- Replaced all ["PurchaseOrderPurchaseOrder"] with ["PurchaseOrder"]
- Replaced all ["WorkorderItemMiscExpenseExpense"] with ["WorkorderItemMiscExpense"]
- Replaced all ["WorkorderItemTravelTravel"] with ["WorkorderItemTravel"]
Note: still some dupes but...fuck it
- TODO: As I code, I will select lt keys as required enter them below
- TODO: Some of the keys are new and not translated from English, when all is done and the keys that will be carried forward are determined, check for untranslated ones
- Use Google translate to get a rough approximation.
- A technique to get a good translation would be to try various synonyms out and try to zero in on the commonality in translation to ensure a word is not being completely misunderstood to get a better translation
- I.E. if different forms of the phrase result in similar words in the other language then it's probably Gucci
CLIENT
- Client fetches localized text on an as required basis form by form and caches it locally until cache is invalidated
- Cache invalidated by either a timeout or possibly receiving a message from the server.
- Open an edit form
- client checks local cache (do I have the values for the list of required keys??)
- YES: just use it
- NO: Send a list of keys to the server along with the user id that are required for this form and get back the LT, put it in the cache
- User id required because someone might edit their locale or the locale name and so it needs to check via the user account what the locale is
This way there is no wasted space at the client caching stuff that will never be used
CHANGES:
- If the text is changed at the server then a notification should occur for clients using that local to invalidate their cache
- Although, that would be a pretty rare event so...maybe not so much, a logout could clear the cache or a login I guess
***********************************************************************************************************************************
LOCALIZED TEXT KEYS ACTUALLY USED
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
This is actually irrelevant now because I'm coding the client to only fetch the exact keys it needs for each form,
so there could be thousands of unused keys and it wouldn't matter.