trigensoftware / i18n-for-browser Goto Github PK
View Code? Open in Web Editor NEWModern translation module for web.
License: MIT License
Modern translation module for web.
License: MIT License
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.
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
π¨ 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.
How do i set up default locale?
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}`)
})
;
});
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?
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!
dependency
@babel/runtime was updated from 7.4.5
to 7.5.0
.π¨ 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.
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
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!
// 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
?
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.
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
dependency
@babel/runtime was updated from 7.4.5
to 7.5.0
.π¨ 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.
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
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.
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
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',
});
π¨ 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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.