Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

frenchkiss

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

frenchkiss - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

2

dist/cjs/frenchkiss.js
/**
* @license frenchkiss 0.0.1
* @license frenchkiss 0.0.2
* Copyright (c) 2018-2019 Koala Interactive, Inc.

@@ -4,0 +4,0 @@ * License: MIT

/**
* @license frenchkiss 0.0.1
* @license frenchkiss 0.0.2
* Copyright (c) 2018-2019 Koala Interactive, Inc.

@@ -4,0 +4,0 @@ * License: MIT

/**
* @license frenchkiss 0.0.1
* @license frenchkiss 0.0.2
* Copyright (c) 2018-2019 Koala Interactive, Inc.

@@ -4,0 +4,0 @@ * License: MIT

{
"name": "frenchkiss",
"version": "0.0.1",
"version": "0.0.2",
"description": "The blazing fast lightweight translation module for javascript",

@@ -5,0 +5,0 @@ "author": "Vincent Thibault <vthibault.mobile@gmail.com>",

@@ -71,7 +71,7 @@ # FrenchKiss.js

goodbye: 'Bye !',
// and other phrases...
// and other sentences...
});
frenchkiss.t('hello', {
name: 'John'
name: 'John',
}); // => 'Hello John !'

@@ -106,3 +106,5 @@ ```

The most used method to returns translation. It's build with performance in concern What you should know about it :
The most used method to returns translation. It's built with performance in mind
Here is what you should know about it :
- ✅ It does support multiple interpolation variable

@@ -114,3 +116,3 @@ - ✅ It supports interpolation.

- ❌ It does not support nested keys _(to keep it fast)_.
- ❌ It does not support date, number, devise formating (maybe check for [Intl.NumberFormat](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/NumberFormat) and [Intl.DateTimeFormat](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/DateTimeFormat)).
- ❌ It does not support date, number, devise formatting (maybe check for [Intl.NumberFormat](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/NumberFormat) and [Intl.DateTimeFormat](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/DateTimeFormat)).

@@ -127,6 +129,6 @@ ```js

> **Note:** By default, if parameters is not given it will be interpreted as an empty string.
> **Note:** By default, if no parameters are given it will be interpreted as an empty string.
If you are working with concurent connections it's also possible to use the third parameter `lang` to force the language to use.
Doing a generator that force the language for use and pass it to your function can be what you are looking for.
If you are working with concurrent connections it's also possible to use the third parameter `lang` to force the language to use.
Doing a generator that forces the language use and pass it to your function can be what you are looking for.

@@ -140,3 +142,3 @@ ```js

// Helper
const generateLanguageTranslator = (lang) => {
const generateLanguageTranslator = lang => {
return (key, params) => frenchkiss.t(key, params, lang);

@@ -164,3 +166,3 @@ };

If you need to clean the data of a stored language for memory optimizations, unset is all you need for.
If you need to clean the data of a stored language for memory optimizations, unset is all you need.

@@ -196,3 +198,3 @@ ---

When the client request a missing key, frenchKiss will returns the key as result. It's possible to handle it and returns what you want or just send an event to your error reporting system.
When the client requests a missing key, frenchKiss will returns the key as result. It's possible to handle it and return what you want or just send an event to your error reporting system.

@@ -217,3 +219,3 @@ ```js

If you needs to display different text messages depending on the value of a variable, you need to translate all of those text messages... or you can handle this with a select ICU expression.
If you need to display different text messages depending on the value of a variable, you need to translate all of those text messages... or you can handle this with a select ICU expression.

@@ -241,3 +243,3 @@ ```js

It's basically the same than select, except you have to use the "=" symbol for direct checking.
It's basically the same as select, except you have to use the "=" symbol for direct checking.

@@ -259,3 +261,3 @@ ```js

> ⚠️ As of select expression, the plural is a lightweight version of [ICU FormatMessage](http://userguide.icu-project.org/formatparse/messages) (`offset:1` and `#` are not integrated).
> ⚠️ Like the select expression, the plural is a lightweight version of [ICU FormatMessage](http://userguide.icu-project.org/formatparse/messages) (`offset:1` and `#` are not integrated).

@@ -266,3 +268,3 @@ ---

It's also possible to work with plural category. Multiples languages have multiple pluralizaton rules. You'll have to write a function returning the type to check.
It's also possible to work with plural category. Multiple languages have multiple pluralization rules. You'll have to write a function returning the type to check.
The functions are not included by default in the package (not needed in most cases). But you can extract them from other populars repositories:

@@ -278,3 +280,4 @@

set('en', {
takemymoney: 'Take {N} dollar{{N, plural, one{} =5{s! Take it} other{s}} please.',
takemymoney:
'Take {N} dollar{{N, plural, one{} =5{s! Take it} other{s}} please.',
});

@@ -284,3 +287,3 @@

plural('en', n => (n !== 1 ? 'one' : 'other'));
plural('fr', n => ((n === 0 || i === 1) ? 'one' : 'other'));
plural('fr', n => (n === 0 || i === 1 ? 'one' : 'other'));
// etc.

@@ -287,0 +290,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc