Amber icon indicating copy to clipboard operation
Amber copied to clipboard

[Feature] Localization string engine

Open CymDeveloppement opened this issue 1 year ago • 7 comments

as described in this guide : http://pgas.freeshell.org/mirror/ABSlocalization.html localization is possible with dollar sign before double quotes

cd $var || error $"Can't cd to %s." "$var"
read -p $"Enter the value: " var

maybe amber can add this sign easily.

this may make it possible in the future to generate translation files easily directly with Amber or with integrated function

CymDeveloppement avatar Jun 18 '24 14:06 CymDeveloppement

or it can be made explicit with a special sign before the double quotes

CymDeveloppement avatar Jun 18 '24 15:06 CymDeveloppement

@CymDeveloppement this is a good question. We could have a special syntax for that local "Hello World" or something similar.

Ph0enixKM avatar Jun 18 '24 16:06 Ph0enixKM

@Ph0enixKM i think a explicit keyword like "local" is a good way

CymDeveloppement avatar Jun 19 '24 08:06 CymDeveloppement

shouldn't this kind of thing be done on a library level?

b1ek avatar Jun 19 '24 11:06 b1ek

shouldn't this kind of thing be done on a library level?

Good question. Adding blindly new keywords and built-ins will increase the learning curve of this language. This is why it actually would be better as an stdlib function. You're right @b1ek.

Ph0enixKM avatar Jun 19 '24 17:06 Ph0enixKM

Adding blindly new keywords and built-ins will increase the learning curve of this language

it will just make it an unstructured mess imo

b1ek avatar Jun 20 '24 02:06 b1ek

Maybe we can start a new repo with libraries in pure Amber and when that function can be imported in the Amber language.

Like for https://github.com/Ph0enixKM/Amber/issues/218, in this way in Amber we add builtin the most basic stuff and for other exotic they get like a review process and a different usage.

So maybe it's time to create a Github organization for the various repositories?

Mte90 avatar Jun 20 '24 08:06 Mte90