From cf993064046afa3be6721889b7b44373429549ec Mon Sep 17 00:00:00 2001 From: Musterknabe Date: Wed, 7 May 2014 19:21:23 +0200 Subject: [PATCH] Updated Documentation --- src/translate.js | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/translate.js b/src/translate.js index 6c5ca2a..63f7222 100644 --- a/src/translate.js +++ b/src/translate.js @@ -4,17 +4,26 @@ * v0.0.2 * * Usage: - * var yourTranslationsObject = { - * translationKey: 'translationValue' + * var messages = { + * translationKey: 'translationValue', + * moduleA: { + * translationKey: 'value123' + * } * } - * - * var t = libTranslate.getTranslationFunction(yourTranslationsObject, debugModeBoolean) - * + * + * var options = { + * debug: true, //[Boolean]: Logs missing translations to console. Defaults to false. + * namespaceSplitter: '::' //[String|RegExp]: You can customize the part which splits namespace and translationKeys. Defaults to '::'. + * } + * + * var t = libTranslate.getTranslationFunction(messages, [options]) + * * t('translationKey') - * t('translationKey', 2) + * t('translationKey', count) * t('translationKey', {replaceKey: 'replacevalue'}) - * t('translationKey', 2, {replaceKey: 'replacevalue'}) - * t('moduleA.translationKey') + * t('translationKey', count, {replaceKey: 'replacevalue'}) + * t('translationKey', {replaceKey: 'replacevalue'}, count) + * t('moduleA::translationKey') * * * @author Jonas Girnatis