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

piral-translate

Package Overview
Dependencies
Maintainers
1
Versions
947
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

piral-translate - npm Package Compare versions

Comparing version 0.9.0-pre.763 to 0.9.0-pre.765

2

lib/create.d.ts

@@ -33,5 +33,5 @@ import { Extend } from 'piral-core';

/**
* Creates a new Piral localization API extension.
* Creates new Pilet API extensions for localization.
* @param localizer The specific localizer to be used, if any.
*/
export declare function createLocaleApi(localizer?: Localizable): Extend<PiletLocaleApi>;

@@ -22,3 +22,3 @@ "use strict";

/**
* Creates a new Piral localization API extension.
* Creates new Pilet API extensions for localization.
* @param localizer The specific localizer to be used, if any.

@@ -25,0 +25,0 @@ */

{
"name": "piral-translate",
"version": "0.9.0-pre.763",
"description": "Extensions for providing translated messages in Piral.",
"version": "0.9.0-pre.765",
"description": "Plugin for providing translated messages in Piral.",
"keywords": [

@@ -12,3 +12,3 @@ "piral",

"api",
"extension",
"plugin",
"translate",

@@ -42,3 +42,3 @@ "locale",

"devDependencies": {
"piral-core": "^0.9.0-pre.763"
"piral-core": "^0.9.0-pre.765"
},

@@ -50,3 +50,3 @@ "peerDependencies": {

},
"gitHead": "244d493ecf0c7986e549b0ee2fe48feb20c52cd9"
"gitHead": "81e14b202558d9c3bcf2f8bfdf0b758d0b4b1043"
}

@@ -5,3 +5,3 @@ [![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)

This is an extension library that only has a peer dependency to `piral-core`. What `piral-translate` brings to the table is a set of API extensions that is used by `piral`. The set features a simple yet sufficient translation system.
This is a plugin that only has a peer dependency to `piral-core`. What `piral-translate` brings to the table is a set of Pilet API extensions that is used by `piral`. The set features a simple yet sufficient translation system.

@@ -12,4 +12,16 @@ ## Documentation

(tbd)
### `translate()`
Returns the translation (i.e., a string defined for the currently selected language) of a provided language key.
Variables can also be provided using an object as the second argument. The variable replacement looks for occurrences of double curly braces, e.g., `{{foo}}`.
### `setTranslations()`
Sets the translations (custom language to key to string mapping) for the pilet.
### `getTranslations()`
Gets the translations defined in the pilet.
## Setup and Bootstrapping

@@ -16,0 +28,0 @@

@@ -50,3 +50,3 @@ import { swap } from '@dbeining/react-atom';

/**
* Creates a new Piral localization API extension.
* Creates new Pilet API extensions for localization.
* @param localizer The specific localizer to be used, if any.

@@ -53,0 +53,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