Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/vexu/i18n-experiment

An experiment at creating an translation library for use with Zig.
https://github.com/vexu/i18n-experiment

i18n zig

Last synced: 29 days ago
JSON representation

An experiment at creating an translation library for use with Zig.

Awesome Lists containing this project

README

        

# i18n experiment

An experiment at creating an translation library for use with Zig.

One goal is that starting to use this should be as easy as
replacing all instances like `writer.print("...", .{...})`
with `i18n.format(writer, "...", .{...})`
where the format string becomes the key for translation.

Translations are specified in `$LOCALE.def` files so for code like
```zig
i18n.format(writer, "Hello {s}!", .{name});
```
A finnish translation file `fi_FI.def` would contain something like:
```
# Comment explaining something about this translation
def "Hello {%name}!"
"Moikka {%name}!"
end
```