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

fluxible-plugin-locale-counterpart

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fluxible-plugin-locale-counterpart

counterpart locale setting plugin for fluxible

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

fluxible-plugin-locale-counterpart

Counterpart locale setting plugin for fluxible.

Use for building beautiful isomorphic app translations.

Installation

npm install fluxible-plugin-locale-counterpart --save

Usage

You need to set locale cookie yourself or using LocaleSwitcher code below.

import localePlugin from "fluxible-plugin-locale-counterpart";

app.plug(localePlugin);

I use react-translate-component in my application.

Here's how LocaleSwitcher looks like:

import React from "react";
import counterpart from "counterpart";
import {Input} from "react-bootstrap";
import Cookies from "cookies-js";

let LocaleSwitcher = React.createClass({
  handleChange: function(e) {
    counterpart.setLocale(e.target.value);
    Cookies.set('locale', e.target.value);
  },

  render: function() {
    return (
      <Input
        type="select"
        className="input-sm"
        groupClassName="form-inline form-menu-inline"
        defaultValue={counterpart.getLocale()}
        onChange={this.handleChange}
        >
        <option value="en">English</option>
        <option value="ru">Русский</option>
      </Input>
    );
  }
});

export default LocaleSwitcher;

Keywords

FAQs

Package last updated on 15 Feb 2015

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