Socket
Socket
Sign inDemoInstall

@blablatec/i18n-js

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blablatec/i18n-js

Javascript i18n Translations manager


Version published
Weekly downloads
19
increased by35.71%
Maintainers
1
Weekly downloads
 
Created
Source

Built With Stencil

I18n-js

Translations library for any javascript based app, using Blablatec.com.

Plain Javascript

index.html

<script type="module" src="https://unpkg.com/@blablatec/i18n-js/dist/i18n-js/i18n-js.esm.js"></script>
<script nomodule src="https://unpkg.com/@blablatec/i18n-js/dist/i18n-js/i18n-js.js"></script>

<i18n-t t-data='{"name": "blablatec!", "url": "https://blablatec.com"}'>Visit us: <a href="(%url)">(%name)</a></i18n-t>

<script>
    // Get it from https://blablatec.com
    const i18nConfig = {
        apiUrl: `https://blablatec.com/api/v1/application/5f7...`,
        appId: 'your-app-id',
        appSecret: 't8GTsNsd...',
    };
    Translator.init(availableLangs, defaultLanguage, i18nConfig);
</script>

Example of use with stencil.js app

app.ts config file:

import { Translator } from '@blablatec/i18n-js';

import './app.deps';

const envConfig: IEnvironmentConfig = {
    env: 'production',
};

const i18nConfig = {
    apiUrl: 'https://blablatec.com/api/v1/application/5f72ea4c19e7f1653faed129',
    appId: 'com.bfidel',
    // eslint-disable-next-line max-len
    appSecret: 't8GTsNsdrBzEO-twbIlZve1OfLIz9Iv3VbNRScMy20sXAO_mt6jsXxbfFbgicBfJr_0fPBaDjxEYhrNFp1ccf4hkTmfmyML_Gk0ZPnVvKpTzqV5hXrXYk8gun2NP2eWpLHB2Jir_bn',
};

export default () => {
    Translator.init(availableLangs, defaultLanguage, i18nConfig);
};

app.deps.ts:

import '@blablatec/i18n-js';
...

your-awesome-component.ts:

import { Component, h, State, Prop } from '@stencil/core';

@Component({
    tag: 'app-home',
    styleUrl: 'app-home.css',
})
export class AppHome {
    render() {
        const tData = {
            url: 'https://blablatec.com',
            name: 'blablatec!',
        };
        return <p><i18n-t t-data={JSON.stringify(tData)}>Visit us: <a href="(%url)">(%name)</a></i18n-t></p>;
    }
}

FAQs

Package last updated on 25 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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