Skip to content

Commit

Permalink
Updated links, license, readme
Browse files Browse the repository at this point in the history
  • Loading branch information
bratan committed Oct 15, 2019
1 parent a0d060f commit 696c8f7
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 Leadcode
Copyright (c) 2019 Florin Bratan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# flutter_translate

[![Build Status](https://travis-ci.org/leadcode/flutter_translate.svg)](https://travis-ci.org/leadcode/flutter_translate)
[![Build Status](https://travis-ci.org/bratan/flutter_translate.svg)](https://travis-ci.org/bratan/flutter_translate)
[![pub package](https://img.shields.io/pub/v/flutter_translate.svg)](https://pub.dev/packages/flutter_translate)
[![License: MIT](https://img.shields.io/badge/License-MIT-ff69b4.svg)](https://github.com/leadcode/flutter_translate/blob/master/LICENSE)
[![License: MIT](https://img.shields.io/badge/License-MIT-ff69b4.svg)](https://github.com/bratan/flutter_translate/blob/master/LICENSE)
[![Flutter.io](https://img.shields.io/badge/Flutter-Website-deepskyblue.svg)](https://flutter.io/)

---
Expand All @@ -11,7 +11,7 @@ The internationalization (i18n) library for Flutter.

It lets you define translations for your content in different languages and switch between them easily.

<img src="https://raw.githubusercontent.com/leadcode/flutter_translate/master/assets/gifs/flutter_translate_screen.gif" width="300"/>
<img src="https://raw.githubusercontent.com/bratan/flutter_translate/master/assets/gifs/flutter_translate_screen.gif" width="300"/>

## Table of Contents
- [Installation](#installation)
Expand Down Expand Up @@ -156,4 +156,4 @@ Widget build(BuildContext context) {

### You can view the full example here:

[https://github.com/leadcode/flutter_translate/blob/master/example/lib/main.dart](https://github.com/leadcode/flutter_translate/blob/master/example/lib/main.dart)
[https://github.com/bratan/flutter_translate/blob/master/example/lib/main.dart](https://github.com/bratan/flutter_translate/blob/master/example/lib/main.dart)
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_translate/flutter_translate.dart';

void main() async {
var delegate = await LocalizationDelegate.create(fallbackLanguage: 'en', supportedLanguages: ['en', 'es_ES', 'fa'], basePath: 'assets/i18n/');
var delegate = await LocalizationDelegate.create(fallbackLanguage: 'en', supportedLanguages: ['en', 'es', 'fa']);
runApp(LocalizedApp(delegate, MyApp()));
}

Expand Down
6 changes: 4 additions & 2 deletions lib/localization_file_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ class LocalizationFileService

Map<String, dynamic> map = jsonDecode(manifest);

return map.keys.where((x) => x.startsWith('$basePath/')).toList();
var separator = basePath.endsWith('/') ? '' : '/';

return map.keys.where((x) => x.startsWith('$basePath$separator')).toList();
}

static String _findLocalizationFile(String languageCode, List<String> localizedFiles, String basePath)
Expand All @@ -59,6 +61,6 @@ class LocalizationFileService
{
var separator = basePath.endsWith('/') ? '' : '/';

return '${basePath}${separator}${languageCode}.json';
return '$basePath$separator$languageCode.json';
}
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_translate
description: The internationalization (i18n) library for Flutter. It lets you define translations for your content in different languages and switch between them easily.
version: 1.2.5
version: 1.2.6
author: Leadcode <[email protected]>
homepage: https://github.com/leadcode/flutter_translate

Expand Down

0 comments on commit 696c8f7

Please sign in to comment.