I18N.jl/test/runtests.jl

29 lines
688 B
Julia

using Test, I18N
# Define it before expanding any _"string"
# Custom function used to get the program language.
# Must return a 2-char language code
macro language()
return esc(:(req[:params][:lang]))
end
@translations it en
@translate "it" "first" "primo"
@translate "it" "third" "terzo"
include("numbers.jl")
include("hello.jl")
@translate "it" "hello" "ciao"
@translator "it" "Nicolò Balzarotti" "nicolo@nixo.xyz" "2020"
@write_po_files "Test" "0.0.0-dev" ["Nicolò Balzarotti <nicolo@nixo.xyz>"] "2020"
let req = Dict(:params => Dict(:lang => "it"))
_"third"
end
print_numbers(Dict(:params => Dict(:lang => "it")))
return_hellos(Dict(:params => Dict(:lang => "it")))