Closed lincmba closed 10 months ago
I ran the tool, here are some observations.
Command:
java -jar build/libs/fhircore-tooling-2.3.1-SNAPSHOT-release.jar translate -m extract -rf ~/Workspace/path/to/app_configs/ -et configs
It was able to successfully generate the strings_configs.properties
file but the original json config files are not replaced with the placeholder values i.e. title: {{ 0aa0ff9c7f02dbddf3009006720e487a }}
. Is this scoped to be handled by the merge command? I think it should be part of the extract
I wonder if we should consider backward compatibility with existing translations or just force all projects to migrate?
See extraction below. Here I ran the tool with some pre-existing previously localized configs. Looking at the last entry it adds the translates value as the already human localized version of the value.
0aa0ff9c7f02dbddf3009006720e487a=Patient profile configuration
31d4eed7402fbe85169766614762b524=Inventory profile configuration
d0c7235ab0bbcaa7abe7e1f6cd596acf={{ search.name.or.id }}
Perhaps the easiest way to fix this is to search for the "{{" placeholder literal and skip extraction for that element. This way the two (manual and tooling) approaches could co-exist.
The alternative is to force replace the existing manual placeholders with newly generated ones that follow the tooling format.
@ndegwamartin Following our discussion and to address the above comment, this is now updated to perform the following:
{
"title": "This is a title"
"title": "{{ old.title.format }}"
}
old.title.format=Old Title Format
output:
{
"title": "{{ ad311e7b380238310da8fae4b28236ca }}"
}
old.title.format=Old Title Format
ad311e7b380238310da8fae4b28236ca=This is a title
This is also backward compatible with former translation standards as items in {{
...}}
are not extracted. Both translations can work together in this.
Addresses two things:
Fixes https://github.com/onaio/fhir-tooling/issues/68 , Fixes https://github.com/onaio/fhir-tooling/issues/62
Engineer Checklist
mvn spotless:apply
to check my code follows the project's style guide