Skip to content

Latest commit

 

History

History
50 lines (37 loc) · 1.92 KB

README.md

File metadata and controls

50 lines (37 loc) · 1.92 KB

LocalisedLiterals.jl

Introduction

LocalisedLiterals.jl provides string literals for every langugage the google translate api supports, and thus bringing the great python feature of native support for french string literals to julia. Now you are no longer forced to move use python, should the need arrise to do something like this:

>>> fr"Bonjour"
'Bonjour'

Disclaimers:

Usage

Prefix any string you want localised with the language code you want it localised in. Remember to replace each - with an _ (mni-Mtei becomes mni_Mtei).

julia> fr"Bonjour"
"Bonjour"

julia> fr"Hello World"
"Bonjour le monde"

julia> da"How much is the fish?"
"Hvor meget koster fisken?"

julia> it"Wer, wie, was, wieso weshalb, warum?"
"Chi, come, cosa, perché, perché, perché?"

julia> es"Hvofor flyttede du til spanien?"
"¿Por qué te mudaste a España?"

julia> mni_Mtei"I can only hope this translation is correct."
"ꯍꯟꯗꯣꯀꯄꯥ ꯑꯁꯤ ꯑꯆꯨꯝꯕꯅꯤ ꯍꯥꯌꯅꯥ ꯑꯩꯅꯥ ꯑꯥꯁꯥ ꯇꯧꯕꯥ ꯉꯝꯃꯤ꯫"

The source language is usually choose automatically by the api. Should you find the need to force a source, you can just append it as a flag:

julia> en"gift"
"gift"

julia> en"gift"de
"poison"

julia> en"gift"da
"married"

(The more I play around with this thing, the more it seems actually useful...)