Open mttrbrts opened 6 years ago
@mttrbrts Could you provide an example of how it might look like at the Ergo language level?
Perhaps something like :
enforce count(request.shipment.sensorReadings) > 0.0
otherwise localize("no-readings", "fr-FR") ;
Could the locale even be an implicit property of the contract instance? This would allow something like:
enforce count(request.shipment.sensorReadings) > 0.0
otherwise localize("no-readings") ;
Where localize uses state.locale
for the lookup?
We should have this discussion in the context of globalization of Cicero templates too. For example, specifying the locale for a template should select the correct template grammar and propagate through to the logic.
Thanks this is helpful.
Localization can be implemented as a library, I imagine?
I think @kach is correct about using a library, except for the implicit use of state.locale
?
Ergo should allow for strings in messages, such as in
enforce
statements, to be globalized / localized.https://github.com/hyperledger/composer/blob/master/packages/composer-common/lib/globalize.js