Git Product home page Git Product logo

i18n-for-browser's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

spown pannavicb

i18n-for-browser's Issues

An in-range update of @trigen/scripts-plugin-size-limit is breaking the build 🚨

The devDependency @trigen/scripts-plugin-size-limit was updated from 2.6.3 to 2.7.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@trigen/scripts-plugin-size-limit is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.

module "./xregexp" not found from "[...]i18n-for-browser\\node_modules\\xregexp\\xregexp-all.js"

After updating from 0.7.0 to 0.9.7 the library does no longer compile using the same [email protected] as before.

Error: module "./xregexp" not found from "β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ\\node_modules\\i18n-for-browser\\node_modules\\xregexp\\xregexp-all.js"
    at notFound (β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ\node_modules\browserify\index.js:803:15)
    at β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ\node_modules\browserify\index.js:754:23
    at β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ\node_modules\browser-resolve\index.js:185:24
    at β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ\node_modules\resolve\lib\async.js:36:22
    at load (β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ\node_modules\resolve\lib\async.js:54:43)
    at β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ\node_modules\resolve\lib\async.js:60:22
    at β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ\node_modules\resolve\lib\async.js:16:47
    at FSReqWrap.oncomplete (fs.js:166:21)
var stream = require('stream'),
    gulp = require('gulp'),
        browfy = require('gulp-browserify'),
        rename = require('gulp-rename'),
        uglify = require('gulp-uglify'),
        gutil = require('gulp-util'),
    defDestDir = './browser_libs/'
;
gulp.task('i18n_for_browser', function() {
    var fakeSrc = stream.Readable({ objectMode: true }),
        nname = "i18n-for-browser.js",
        res = true
    ;
    fakeSrc._read = function () {
        this.push(new gutil.File({
            cwd: "./node_modules",
            base: "i18n-for-browser-loader.js",
            path: "i18n-for-browser-loader.js",
            contents: new Buffer('i18n = require("i18n-for-browser");')
        }))
        this.push(null) //terminates file stream? hangs without
    }
    return fakeSrc
        .pipe(browfy())
        .on("error", function(error) {
            gutil.log(gutil.colors.red(error.stack));
            res = false
            this.emit("end");
        })
        .pipe(rename(nname))
        .pipe(uglify({preserveComments:'license'}))
        .pipe(gulp.dest(defDestDir))
        .on('finish', function(arg) {
            res && gutil.log(`built i18n-for-browser.js -> ${defDestDir+nname}`)
        })
    ;
});

Add a hook for when a phrase lookup failed

One useful feature of i18-node is that it adds missing phrases back to the dictionary, so we can easily go in there and just update what is missing But that is not easy for a client-side library to do, because clients usually won't have access to write files.

In our setup, we are storing locale files on the server, and the client is fetching the one it needs, and putting it into i18n-for-browser.

Our current thinking is to send a message back to the server whenever a phrase is missing, so that the server can save the missing phrase in the relevant locale file (either using i18-node, or with some custom code).

Would you like to add an option to this library, so that I can pass an optional callback which will be called whenever a phrase is missing?

Or, if I should do it myself, where would be the appropriate place to add the callback?

  1. The translate() function looks like a central point. I think if acessor() returns nothing, then I need to register the phrase in the variable singular. Is that right?

Thanks!

An in-range update of babel7 is breaking the build 🚨

There have been updates to the babel7 monorepo:

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

This monorepo update includes releases of one or more dependencies which all belong to the babel7 group definition.

babel7 is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Add changelog

Please make either releases through github and use the description field of each release to highlight the changes or use a CHANGELOG.md file to track the changes. Also maybe i missed a changelog file. I would really appreciate it, if you would add one!

WTF is this?

// load modules
import * as i18n from 'i18n-for-browser';
now you are ready to use a i18n.__('Hello').

No I'm not. How is this for browser exactly? Where is the browser library? Is there a test case? Do I need to compile something before I call it from from the browser? If so with what and how? There is this line in the example

<script src="js-file-with-imported-i18n-for-browser.js"></script> 

how do I produce this js-file-with-imported-i18n-for-browser.js?

An in-range update of size-limit is breaking the build 🚨

The devDependency size-limit was updated from 0.21.0 to 0.21.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

size-limit is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of babel7 is breaking the build 🚨

There have been updates to the babel7 monorepo:

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

This monorepo update includes releases of one or more dependencies which all belong to the babel7 group definition.

babel7 is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @types/node is breaking the build 🚨

The dependency @types/node was updated from 12.7.0 to 12.7.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/node is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • βœ… coverage/coveralls: First build on greenkeeper/@types/node-12.7.1 at 85.354% (Details).
  • ❌ Travis CI - Branch: The build errored.

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Example doesn't seem to be valid javascript

locales.en: { ... } is not valid javascript afaik.

Could the example be fixed?

i18n.configure({
    // store of translations
    locales: {
        'en': {...},
        'ru': {...}
    },
    // sets a custom cookie name to read/write locale  - defaults to NULL
    cookieName: 'yourcookiename',
});

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.

Does this work along with the existing i18n setup?

Want to know if it works out of the box with the already configured i18n-node setup from mashpie or works separately. I'm looking for something like a simple port of the i18n-node to use in client side

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.