Skip to content
This repository has been archived by the owner on Sep 7, 2023. It is now read-only.

Globalization for strings #269

Open
mttrbrts opened this issue Jul 9, 2018 · 5 comments
Open

Globalization for strings #269

mttrbrts opened this issue Jul 9, 2018 · 5 comments
Labels
Type: Feature Request 🛍️ New feature or request

Comments

@mttrbrts
Copy link
Member

mttrbrts commented Jul 9, 2018

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

@jeromesimeon
Copy link
Member

@mttrbrts Could you provide an example of how it might look like at the Ergo language level?

@mttrbrts mttrbrts added the Type: Feature Request 🛍️ New feature or request label Jul 11, 2018
@mttrbrts
Copy link
Member Author

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.

@jeromesimeon
Copy link
Member

Thanks this is helpful.

@kach
Copy link
Contributor

kach commented Aug 3, 2018

Localization can be implemented as a library, I imagine?

@jeromesimeon
Copy link
Member

I think @kach is correct about using a library, except for the implicit use of state.locale?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Feature Request 🛍️ New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants