From 7200c69d832b30936d2c0ad2c611c1a1d5d904f7 Mon Sep 17 00:00:00 2001 From: William DURAND Date: Mon, 1 Aug 2011 01:05:14 +0200 Subject: [PATCH] Fixed license + credits --- README.markdown | 4 +++- Resources/doc/README.markdown | 44 ++++++++++++++++++----------------- Resources/meta/LICENSE | 19 +++++++++++++++ 3 files changed, 45 insertions(+), 22 deletions(-) create mode 100644 Resources/meta/LICENSE diff --git a/README.markdown b/README.markdown index 832306db..7b357c89 100644 --- a/README.markdown +++ b/README.markdown @@ -239,4 +239,6 @@ bazinga_expose_translation: ## Credits -* William DURAND (Bazinga). +* William DURAND (Bazinga) as main author. +* Jan Sorgalla as contributor. +* Stan Chollet as contributor. diff --git a/Resources/doc/README.markdown b/Resources/doc/README.markdown index d449538d..7b357c89 100644 --- a/Resources/doc/README.markdown +++ b/Resources/doc/README.markdown @@ -48,7 +48,7 @@ Register the routing in `app/config/routing.yml`: ``` yaml # app/config/routing.yml _bazinga_exposetranslation: - resource: "@BazingaExposeTranslationBundle/Resources/config/routing/routing.xml" + resource: "@BazingaExposeTranslationBundle/Resources/config/routing/routing.yml" ``` Publish assets: @@ -102,10 +102,10 @@ This will provide translated messages found in each `DOMAIN_NAME.MY_LOCALE.*` fi It's quite simple: ``` javascript -$.ExposeTranslation.has('DOMAIN_NAME:key'); +ExposeTranslation.has('DOMAIN_NAME:key'); // true or false -$.ExposeTranslation.get('DOMAIN_NAME:key'); +ExposeTranslation.get('DOMAIN_NAME:key'); // the translated message or undefined ``` @@ -115,7 +115,7 @@ If you don't specify any **domain**, a guesser is provided to find the best tran To configure the guesser, you have to set the `defaultDomains` attribute. By default, the configured default domain is `messages`. ``` javascript -$.ExposeTranslation.get('key'); +ExposeTranslation.get('key'); // will try to find a translated message in default domains. ``` @@ -128,7 +128,7 @@ Read the official documentation about Symfony2 [message placeholders](http://sym The `get()` method accepts a second argument that takes placeholders without `%` delimiters: ``` javascript -$.ExposeTranslation.get('DOMAIN_NAME:key', { "foo" : "bar" }); +ExposeTranslation.get('DOMAIN_NAME:key', { "foo" : "bar" }); // will replace each "%foo%" in the message by "bar". ``` @@ -148,27 +148,27 @@ apples: "{0} There is no apples|{1} There is one apple|]1,19] There are %count% ``` ``` javascript -$.ExposeTranslation.locale = 'en'; +ExposeTranslation.locale = 'en'; -$.ExposeTranslation.get('apples', {"count" : 0}, 0); +ExposeTranslation.get('apples', {"count" : 0}, 0); // will return "There is no apples" -$.ExposeTranslation.get('apples', {"count" : 1}, 1); +ExposeTranslation.get('apples', {"count" : 1}, 1); // will return "There is one apple" -$.ExposeTranslation.get('apples', {"count" : 2}, 2); +ExposeTranslation.get('apples', {"count" : 2}, 2); // will return "There are 2 apples" -$.ExposeTranslation.get('apples', {"count" : 10}, 10); +ExposeTranslationExposeTranslation.get('apples', {"count" : 10}, 10); // will return "There are 10 apples" -$.ExposeTranslation.get('apples', {"count" : 19}, 19); +ExposeTranslation.get('apples', {"count" : 19}, 19); // will return "There are 19 apples" -$.ExposeTranslation.get('apples', {"count" : 20}, 20); +ExposeTranslation.get('apples', {"count" : 20}, 20); // will return "There are many apples" -$.ExposeTranslation.get('apples', {"count" : 100}, 100); +ExposeTranslation.get('apples', {"count" : 100}, 100); // will return "There are many apples" ``` @@ -179,7 +179,7 @@ $.ExposeTranslation.get('apples', {"count" : 100}, 100); You can get the current locale by accessing the `locale` attribute: ``` javascript -$.ExposeTranslation.locale; +ExposeTranslation.locale; // will return the current locale. ``` @@ -205,22 +205,22 @@ placeholder: "Hello %username%, how are you ?" You can do: ``` javascript -$.ExposeTranslation.get('Hello:foo'); +ExposeTranslation.get('Hello:foo'); // will return 'Bar' if the current locale is set to 'fr', undefined otherwise. -$.ExposeTranslation.get('Hello:ba.bar'); +ExposeTranslation.get('Hello:ba.bar'); // will return 'Hello world' if the current locale is set to 'fr', undefined otherwise. -$.ExposeTranslation.get('Hello:placeholder'); +ExposeTranslation.get('Hello:placeholder'); // will return 'Hello %username% !' if the current locale is set to 'fr', undefined otherwise. -$.ExposeTranslation.get('Hello:placeholder', { "username" : "will" }); +ExposeTranslation.get('Hello:placeholder', { "username" : "will" }); // will return 'Hello will !' if the current locale is set to 'fr', undefined otherwise. -$.ExposeTranslation.get('placeholder', { "username" : "will" }); +ExposeTranslation.get('placeholder', { "username" : "will" }); // will return 'Hello will, how are you ?' if the current locale is set to 'fr', undefined otherwise. -$.ExposeTranslation.get('placeholder'); +ExposeTranslation.get('placeholder'); // will return 'Hello %username%, how are you ?' if the current locale is set to 'fr', undefined otherwise. ``` @@ -239,4 +239,6 @@ bazinga_expose_translation: ## Credits -* William DURAND (Bazinga). +* William DURAND (Bazinga) as main author. +* Jan Sorgalla as contributor. +* Stan Chollet as contributor. diff --git a/Resources/meta/LICENSE b/Resources/meta/LICENSE new file mode 100644 index 00000000..b5d0ed9d --- /dev/null +++ b/Resources/meta/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2011 William Durand + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE.