Code Monkey home page Code Monkey logo

meteor-internationalization's Issues

please change file structure in doc (duplicate en)?

โ”œโ”€โ”€ en/ //--> Localization folder with name of country two-letter code
    |   โ”œโ”€โ”€ file.json
    |   โ””โ”€โ”€ subFolder/ 
    |       โ””โ”€โ”€ anotherFile.json
    |
    โ”œโ”€โ”€ en/ //--> Localization folder with name of country two-letter code
    |   โ”œโ”€โ”€ file.json
    |   โ””โ”€โ”€ subFolder/ 
    |       โ””โ”€โ”€ anotherFile.json
    |

Can all properties be stored in a separate json or yml file per language?

Hi thanks for sharing this. Quick question: Can all properties be stored in a separate json or yml file per language?

The readme file seems to indicate a path to a file for each language/locale, but I can't find a specific example... not sure if the file should be JSON or YML or if the name matters.

path: "i18n/ru/"

Passing number to options will not replace the placeholder

Reproduction:

  • define i18n.json with a simple replacer pattern:
{
  "max": "You reached {{max}} %"
}

Then pass a number value to it:

const max = 75
i18n.get('max', { max }) // returns You reached {{max}} %

If the value is a string, it's all fine:

const max = '75'
i18n.get('max', { max }) // returns You reached 75 %

Make Template helpers optional

We use a custom Template helper and would like to omit the internal one, for example by passing helperName: null and helperSettingsName: null. If null is passed then there would be no helper created.

Example would be:

      if (typeof Template !== 'undefined' && Template !== null) {
        if (this.helperName !== null) {
          /**
           * @summary Main `i18n` template helper
           */
          Template.registerHelper(this.helperName, function () {
            return self.get.apply(self, arguments);
          });
        }

        if (this.helperSettingsName !== null) {
          /**
           * @summary Settings `i18n` template helper, might be used to build language switcher (see demo folder).
           */
          Template.registerHelper(this.helperSettingsName, function () {
            return self.getSetting.apply(self, arguments);
          });
        }
      }

what do you think?

how to SWITCHER language UI?

I try add this to my template:

// home.html
{{> i18nSwitcher}}
---------------------------
<template name="i18nSwitcher">
  <ul class="">
    {{#each Session 'i18nConfig'}}
      {{> i18nList}}
    {{/each}}
  </ul>
</template>

<template name="i18nList">
{{#if this.value.code}}
  {{#if compare this.value.code '!==' this.currentLocale}}
    <li>
      <a href="#" onclick="i18n.setLocale('{{this.value.code}}'); return false;">{{this.value.name}}</a>
    </li>
  {{/if}}
{{/if}}
</template>

but don't show any thing.

Fiber

@RavisMsk
if I comments all lines which runs (initiate) i18n I still get errors.
By removing Fiber = Npm.require "fibers" - every gets fine, until you run i18n and didn't get Fiber is not defined error

I've pushed non error code, with commented lines
Any idea around this?

Meteor Example

Is there a complete Meteor/Blaze and Meteor/React example I can reference?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.