Skip to content

henrik-wolf/LocalisedLiterals.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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...)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages