Commit 96b1cb04 authored by Eisha Chen-yen-su's avatar Eisha Chen-yen-su

Make work gettext-rs

parent 7865958d
# French translations for testgettextrs package
# Traductions fran�aises du paquet testgettextrs.
# Copyright (C) 2018 THE testgettextrs'S COPYRIGHT HOLDER
# This file is distributed under the same license as the testgettextrs package.
# French translations for PACKAGE package.
# Copyright (C) 2018 THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# Eisha <eisha@ernesto>, 2018.
#
msgid ""
msgstr ""
"Project-Id-Version: testgettextrs 0.1\n"
"Report-Msgid-Bugs-To: chenyensu0@gmail.com\n"
"POT-Creation-Date: 2018-05-15 00:04+0200\n"
"PO-Revision-Date: 2018-05-15 00:08+0200\n"
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-05-15 12:33+0200\n"
"PO-Revision-Date: 2018-05-15 12:34+0200\n"
"Last-Translator: Eisha <eisha@ernesto>\n"
"Language-Team: French\n"
"Language: fr\n"
......@@ -18,6 +17,12 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: src/main.rs:10
msgid "Hello world"
msgstr "Bonjour tout le monde"
#: ../src/main.rs:10
msgid "Open"
msgstr "Ouvrir"
#: ../src/main.rs:13 ../src/main.rs:14
msgid "Text Editor"
msgid_plural "Text Editors"
msgstr[0] "Un éditeur de texte"
msgstr[1] "Des éditeurs de texte"
......@@ -6,17 +6,24 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: testgettextrs 0.1\n"
"Report-Msgid-Bugs-To: chenyensu0@gmail.com\n"
"POT-Creation-Date: 2018-05-15 00:04+0200\n"
"PO-Revision-Date: 2018-05-15 00:04+0200\n"
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-05-15 12:33+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
#: src/main.rs:10
msgid "Hello world"
#: ../src/main.rs:10
msgid "Open"
msgstr ""
#: ../src/main.rs:13 ../src/main.rs:14
msgid "Text Editor"
msgid_plural "Text Editors"
msgstr[0] ""
msgstr[1] ""
......@@ -2,10 +2,14 @@ extern crate gettextrs;
use gettextrs::*;
fn main() {
setlocale(LocaleCategory::LcAll, "fr_FR.UTF-8");
bindtextdomain("gedit", "/usr/share/locale");
textdomain("gedit");
setlocale(LocaleCategory::LcAll, "");
bindtextdomain("test", "./po");
textdomain("test");
println!("Originale: Open");
println!("Original: Open");
println!("Translated: {}", gettext("Open"));
println!("Original: Text Editor");
println!("Translated singular: {}", ngettext("Text Editor", "Text Editors", 1));
println!("Translated plural: {}", ngettext("Text Editor", "Text Editors", 2));
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment