Skip to content

Instantly share code, notes, and snippets.

View maerzbow's full-sized avatar

Markus Merzinger maerzbow

View GitHub Profile
{
"title": "Titel",
"body": {
"paragraph": "Dies ist ein Paragraph."
},
"users": {
"form": {
"submit": "Speichern"
},
"salutation": "Hallo {{name}}"
{
"title": "Titel",
"body.paragraph": "Dies ist ein Paragraph.",
"users.form.submit": "Speichern",
"users.salutation": "Hallo {{name}}"
}
"Title","Description","en","pl","de"
"settings","General Settings","Settings","Ustawienia","Einstellungen"
"has_placeholders","This example shows the usage of placeholders","Hello {username}","Cześć {username}","Hallo {username}"
"quotes","Quotes in content","Hello ""LingoHub""","Cześć ""LingoHub""","Hallo ""LingoHub"""
"linebreaks","an example for linebreaks","Here is a
linebreak","Oto
nowa linea","Hier ist ein
Zeilenumbruch"
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<string name="deutscher string">actually german: muss grösser gleich %d sein</string>
<string name="escaped quotes">Logged in as \"%s\"</string>
<string name="escaped single quotes">Logged in as \'%s\'</string>
<string name="surrounded quotes">"Logged in as '%s'"</string>
<string name="surrounded quotes escaped">"Logged in as \'%s\'"</string>
<!-- single line comment -->
// this comment will be parsed as header comment
"In a typical strings file the key is the text of the target language"="the value holds the translated text";
// an alternative is to use generic keys
"page.main.title"="Titel der Hauptseite";
/* comments in .strings files
can be multi line,
single line */
@maerzbow
maerzbow / LingoHub Java.en-US.properties
Last active August 29, 2015 14:19
LingoHub Java properties
# this comment will be interpreted as header comment
# the value can continue to the next line if the previous line ends with a backslash
welcome_message = Welcome back, \
we have missed you
# multi line comments belong to the next key value pair
# as long as they are not interrupted by a white line
visit_count = this is your {visit} visit to our site
# this comment is ignored because it is not directly followed by a key-value pair
en:
# this comment is also ignored,
# because it is followed by a key that has children nodes
header:
hello_user : Hello %{username}
# comments are treated as translation descriptions
# belonging to the key-value pair that follows
# lingochecks as well
# lh-check {placeholders:true, terms: Lingohub, min: -5, max:+5}
@maerzbow
maerzbow / EnsureEncoding_part.java
Created June 29, 2014 14:49
EnsureEncoding main part
/**
* will try to convert the given chars to a valid string.
* will check for every valid conversion if the given {@link ContentCheck} is valid, if not
* it will continue with the next encoding
*
* @param chars
* characters in an unknown charset
* @param check
* this instance will be called for every valid conversion
* @return the chars converted to a String decoded by the first matching {@link Charset}
@maerzbow
maerzbow / EnsureEncoding.java
Last active November 16, 2018 00:19
EnsureEncoding.java
import static java.nio.charset.StandardCharsets.ISO_8859_1;
import static java.nio.charset.StandardCharsets.UTF_16BE;
import static java.nio.charset.StandardCharsets.UTF_16LE;
import static java.nio.charset.StandardCharsets.UTF_8;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.CharacterCodingException;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
@maerzbow
maerzbow / push_resource_files.sh
Created January 19, 2013 20:38
pushing resource files to lingohub using the lingohub CLI client. see: https://www.ruby-toolbox.com/projects/lingohub
lingohub resource:up config/locales/en/en.yml --locale 'en' --project 'lht'
lingohub resource:up config/locales/de/de.yml --locale 'de' --project 'lht'
lingohub resource:up config/locales/ja/ja.yml --locale 'ja' --project 'lht'