Skip to content

Instantly share code, notes, and snippets.

View maerzbow's full-sized avatar

Markus Merzinger maerzbow

View GitHub Profile
@maerzbow
maerzbow / en-us.constants.json
Created December 3, 2018 11:25
Lingohub example go-i18n.json
[
{
"id": "d_days",
"translation": {
"one": "{{.Count}} day",
"other": "{{.Count}} days"
}
},
{
"id": "my_height_in_meters",
@maerzbow
maerzbow / php_define.php
Created May 24, 2016 16:22
example file for php define i18n segments
<?php
# A header comment for
# the file.
# a comment for the LOGOFF segment
define('LOGOFF', 'Log off');
define("DOUBLE_QUOTES", "'single' and \"double\" quotes");
define("SINGLE_QUOTES", '\'single\' and "double" quotes');
DEFINE('PLACEHOLDER', 'Hello %s!');
DEFINE('MULTI_LINE', 'A multi line \n string.');
---
- hosts: elasticsearch
sudo: yes
vars_files:
- vars/credentials.vault.yml
- vars/elasticsearch.vars.yml
roles:
- lingohub.common
- lingohub.oracle-jdk
- lingohub.elasticsearch
; this comment is ignored because it is not directly followed by a key-value pair
; this comment will be stored along with the section information
[section1]
; comments in .ini files can start with hash
hello_user = Hello stranger!
[section2]
; this key belongs to section2 and no longer to section1
{
"hello_user" : "Hello {username}",
"_welcome.comment" : "keys with .comment suffix are treated as translation descriptions belonging to that key-value pair",
"_welcome.comment" : "multiple comments for the same key-value pair are allowed.",
"welcome" : "Welcome to LingoHub! This is your {visit_count} visit.",
"_welcome.comment" : "lh-check {placeholders:true, terms: LingoHub, min: -5, max:+5}"
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<data name="Common_AuthenicationFailed" xml:space="preserve">
<value>Authentifikation fehlgeschlagen</value>
<comment>comment will be assigned as description to translation "Common_AuthenicationFailed"</comment>
</data>
<data name="Common_Billable" xml:space="preserve">
<value>Verrechenbar</value>
<comment>lh-check { min: 10, max: 15 }</comment>
</data>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="de_DE">
<context>
<name>Page</name>
<message>
<source>Translations Example</source>
<translation>Beispiel für Übersetzungen</translation>
</message>
<message>
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.2"
xmlns="urn:oasis:names:tc:xliff:document:1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-strict.xsd">
<file original="sample.properties"
source-language="en" target-language="de"
datatype="javapropertyresourcebundle">
<body>
<trans-unit id="1" resname="key1">
# a generic key
author.name.not_blank: Please enter an author name.
# placeholder example
users.salutation: "Hello %{username}"
# source language text used as key
"Symfony2 is great": J'aime Symfony2
# header comment
msgid ""
msgstr ""
"Project-Id-Version: LingoHub 1.6.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-05-05 19:22+0200\n"
"PO-Revision-Date: 2013-04-29 10:16+0100\n"
"Last-Translator: Translator <[email protected]>\n"
"MIME-Version: 1.0\n"