rmariuzzo/Lang.js

Implement `get` method

Closed this issue · 2 comments

Summary

As a user, I would like to have a get method that implement Illuminate/Translation/Translator#get method.

Description

The method should accept 3 arguments: key, replacements and locale.

  • key — a string indicating the translation key.
  • replace — an object of replacements values. Example: { key1: 'value1', key2: 'value2' }.
  • locale — a string indicating the locale to use. This should be optional, when not set, use getLocale().

The method will return a localised string for the given key if found, otherwise the given key.

Tests

The test/spec/lang_get_spec.js should fully cover all cases of get method.

@rmariuzzo taking this one as well, as is needed for the Lang.choice method.

Cool!
On Aug 23, 2015 4:59 AM, "German Popoter" notifications@github.com wrote:

@rmariuzzo https://github.com/rmariuzzo taking this one as well, as is
needed for the Lang.choice method.


Reply to this email directly or view it on GitHub
#5 (comment).