For example:
Loose Text
Sales Orders
Replaced by:
{{'ui.storefront.userDashboard.salesDetail.SalesOrders' | translate}}
That is
{{ }} // Angular Binding
'' // This key is a string and should be wrapped in single quotes
ui. // This is a UI label
storefront. // This is in the storefront, alternatively this would be admin
userDashboard. // This is the folder it is in under the store folder
salesDetail. // This is the file it is in
SalesOrders // A collapse of the original string, strings that are especially longNOTE: These should be Capitalized.
CLIENT // If a client wants a textual variation, customized to their business
| translate // angular Translate filter, a module we have added which uses
The above works for areas where you can't do the following, use the
following in every other case:
<tag data-translate="ui.storefront.userDashboard.salesDetail.SalesOrders"></tag>
The reason to do this is because the data-translate attribute actually respects the translate cloaking so you don't see the translate key before the translations have loaded (you see a blank instead).
In some cases, you can't put the data-translate attribute on the same tag as another angular directive, like ui-sref-plus. In these cases, add a span inside the tag and put the data-translate attribute on that:
<tag some-angular-directive>
There is also a clash when you have multiple of these translations side-by-side in something like a <p> tag. Create spans to run each key:
<p>
When replacing text with keys, try to use existing keys from the same file or the common space if possible, else add the new key to the Google Doc and alert your PM that translations need to be updated. See James G. for assistance, if you do not have edit rights to the document.
Official google sheet (2020.4.8) (2021.1+)
For Back End Team: If you need to seed the database with the translation values, you can select the SQL to Upsert Content column of the Admin and Storefront tabs and paste it into a SQL Server 2014 New Query window, replace the double quotes throughout the window with blank, look for "EXECUTE and replace with EXECUTE and GO" with GO and then run it. There will be about a dozen errors for keys that are too long and can't put null values in keys, ignore these, the rest all ran in the stored procedure. This should Upsert the data (insert if new, update if present). Reload the page and the labels should load.
DO NOT RED GATE THIS DATA FROM ANOTHER SITE, USE THE GOOGLE DOC TO MOVE THE DATA.
NOTE: This is for very old versions of CEF that were using the redis cache and an API call for translations. Newer versions of CEF output the translations to static files using the Scheduler.
This will wipe the Cache and let it rebuild with the updated data. The first time it loads it will take longer but after that it should average about 6ms per call.