Skip to content

Instantly share code, notes, and snippets.

View Jonathanlight's full-sized avatar
🎯
Focusing

jonathan Jonathanlight

🎯
Focusing
  • Paris
View GitHub Profile
@Jonathanlight
Jonathanlight / setup-npm-gulp-sass.sh
Created August 31, 2021 09:33 — forked from dgoguerra/setup-npm-gulp-sass.sh
Install node, npm, bower, gulp, compass in Ubuntu 16.04
sudo apt-get install -y git-core
sudo apt-get install -y curl
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo npm install -g bower
sudo npm install -g gulp
sudo apt-get install -y ruby ruby-dev
{
"title": "Test App Anglais",
"label": {
"main": "Hello {user}!"
},
"button": {
"clickMe": "Click here"
},
"toastMessage": "You clicked on button!",
"clicked": {
import 'package:flutter/material.dart';
import 'package:flutter_i18n/flutter_i18n.dart';
import 'package:flutter_i18n/flutter_i18n_delegate.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
class MyHomeState extends State<MyHomePage> {
Locale currentLang;
int clicked = 0;
@override
void initState() {
super.initState();
new Future.delayed(Duration.zero, () async {
await FlutterI18n.refresh(context, new Locale('fr'));
setState(() {
new Text(
FlutterI18n.translate(context, "label.main",
Map.fromIterables(["user"], ["Flutter lover"]))
),
new Text(
FlutterI18n.plural(context, "clicked.times", clicked)
),
new FlatButton(
color: Colors.blue,
onPressed: () async {
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter I18n',
debugShowCheckedModeBanner: false,
theme: new ThemeData(
primarySwatch: Colors.green,
import 'package:flutter/material.dart';
import 'package:flutter_i18n/flutter_i18n.dart';
import 'package:flutter_i18n/flutter_i18n_delegate.dart';
import 'package:flutter_localizations/flutter_localizations.dart';