Remove hard coded strings from UI and extract from doc source files instead
See original GitHub issueThis is a…
[x] Feature request
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Documentation issue or request
The problem
The problem is that currently all of the text used within the UI is hard coded in template/controller files. This blocks us from doing two important things
-
Driving tooltip text from the actual docs as made possible in https://github.com/syndesisio/syndesis/pull/1369
-
Supporting internationalization and localization
This issue is an evolution of https://github.com/syndesisio/syndesis/issues/295, and is meant to encompass all the site text, and not just tooltip content. Having all the language used in the site scattered across many files makes updating text time consuming and difficult.
Expected behavior
The UI should never use literal text strings, but instead use a mechanism (probably a language service) that allows one to specify string keys, which in turn generate the appropriate text at runtime.
This will help improve consistency of the language used within the app and also speed up time required to update text on the site by moving power of control over to those who should have it in the first place.
Related Issues
https://github.com/syndesisio/syndesis-documentation/issues/20 https://github.com/syndesisio/syndesis-documentation/issues/23 https://github.com/syndesisio/syndesis/issues/295
API Endpoints and Schemas
doc/tooltips/tooltips.json
Tasks involved / Steps to Reproduce
- Move hard coded tooltip text into
doc/tooltips/tooltips.json
and negotiate key names with @TovaCohen - Use mvn plugin tooling to generate tooltips.json so DOC folks then have finite control
- Repeat this process for all site text, beyond just tooltips
- Confirm what languages/locals we intend to support
- Make a decision on whether or not we intend to support RTL languages
- Address styling issues that come up, for example German translations are often much longer character strings than their English counterparts. The UI may not currently handle this flawlessly.
I can see number 3 above becoming quite a large work item, so it may make sense to turn this into an Epic and break the task down into more manageable chunks. I’ll let someone else make the call as to how best we can divide up this work.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top GitHub Comments
@TovaCohen I’m putting together a comprehensive tutorial about how to manage text strings through the dictionary file with guidelines for both content editors and frontend developers about how to approach and take advantage of this implementation. I’ll merge it today, so I’d recommend everyone involved in this endeavor to hold off before editing the master dictionary files. Thanks 😃
Regarding steps [1] and [3], we should store all dictionary entries in a single JSON file. There’re several arguments for that:
en-gb.json
This renders: This Integration has been used X times in the Syndesis application.
es-es.json
This renders: Esta Integración ha sido utilizada X veces en la aplicación Syndesis.
Please notice the divergences between placeholder lcoation. You get the drill… Please also notice how we will want to inject the X amount of uses dynamically.
The above can only be accomplished when handling a single file. Otherwise we might run into racing conditions. In regards of implementation from an UI POV, we will want to provide:
[innerHtml]
attribute in the form of a directive that wraps syntactic sugar around said attribute to avoid having to use the aforementioned pipe inside that attribute.I have already developed an implementation of all the above, and am just waiting for clearance, 3 working days and a working environment to get this done.