Permalink
Browse files

doc: Strong-Mode support, README improved

  • Loading branch information...
MikeMitterer committed Nov 16, 2016
1 parent 5df6107 commit 5532669a19e08d9ec71f5280975be2f847ba1403
Showing with 118 additions and 86 deletions.
  1. +16 −0 .analysis_options
  2. +32 −34 README.md
  3. +3 −2 {lib → bin}/mkl10nlocale.dart
  4. +0 −1 ex.sh
  5. +3 −3 lib/src/l10n/L10NImpl.dart
  6. +0 −1 mkl10nlocale
  7. +56 −44 pubspec.lock
  8. +7 −0 pubspec.yaml
  9. +1 −1 tool/grind.dart
View
@@ -0,0 +1,16 @@
# ------------------------------------------------------------------------------
# Config for Analyzer
# More: https://pub.dartlang.org/packages/analyzer
#
# Analyzer options:
# https://www.dartlang.org/guides/language/analysis-options
#
analyzer:
strong-mode: true
# Exclude wegen https://github.com/dart-lang/sdk/issues/26420
# und https://github.com/dart-lang/test/issues/436
# exclude:
# - test/**
View
@@ -1,39 +1,45 @@
l10n / (gettext-oriented) PO-File Generator
-------------------------------------------
####Helps to localize your application####
> Helps to localize your application
[![Screenshot][1])](http://www.youtube.com/watch?v=vPfl-xPTjs0)
#### Install
```bash
$ pub global activate l10n
```
###Install - WORKS###
### System requirements
* xgettext
* msginit
* msgmerge
(only if you want to generate PO/POT files)
```yaml
dependencies:
...
l10n: any
To verify it they are on your system type:
```bash
$ type xgettext
```
If you get an error message - do the following:
```bash
pub update
ln -s packages/l10n/mkl10nlocale.dart mkl10nlocale
mkl10nlocale --help
$ brew install gettext
# on Linux: apt-get install gettext
```
####Install (should work)####
In Dart(-sdk) 1.6
Edit ~/.bashrc and add:
```bash
$ pub global activate l10n
# mkl10nlocale
export PATH=${PATH}:/usr/local/opt/gettext/bin
```
should works... - <b>BUT DOES NOT!!!!</b>
You can run the script from any local directory.
To activate your settings:
```bash
$ pub global run l10n:mkl10nlocale --help
$ source ~/.bashrc
```
<b>pub global activate + run seams not ready!</b> As said - make a symlink and you are done!
###How to use it###
### How to use it
[![Screenshot][1])](http://www.youtube.com/watch?v=vPfl-xPTjs0)
(You have to watch it in 1080p - sorry! Better screencast will follow)
**Sample code**
```dart
import 'package:intl/intl.dart';
import 'package:intl/intl_standalone.dart';
@@ -80,7 +86,7 @@ SystemLocale: de_AT
Dies ist ein TEST!
```
###How to use it with AngularDart###
### How to use it with AngularDart
- Write your Filter for Angular
```dart
@@ -158,7 +164,7 @@ class SampleModule extends Module {
</div>
```
####Sub-Translations###
#### Sub-Translations
Since 0.11.0 Sub-Translations are possible - here is the explanation:
```
@@ -198,26 +204,18 @@ locale/en/.../messages.po:
You have to add the msgid "Servermessage {{statuscode-400}}." by hand to your <strong>POT</strong>-File.<br>
The rest is done be the nice merging-feature of l10n/msgmerge
###System requirements###
* xgettext
* msginit
* msgmerge
These programs are on your system if you are working on Mac or Linux.
(only if you want to generate PO/POT files)
###If you have problems###
### If you have problems
* [Issues][2]
###History ###
### History
* 0.15.12 - toJson converts vars not to "encodable" values
* 0.11.0 - Sub-Translations are possible, msginit gets initialized with utf-8 per default
* 0.9.0 - Released on pub
###License###
### License
Copyright 2014 Michael Mitterer (office@mikemitterer.at),
Copyright 2016 Michael Mitterer (office@mikemitterer.at),
IT-Consulting and Development Limited, Austrian Branch
Licensed under the Apache License, Version 2.0 (the "License");
@@ -203,8 +203,9 @@ class Application {
return true;
}).any((final File file) {
//_logger.fine(" Found: ${file}");
}).map((final FileSystemEntity entity) => new File(entity.path))
.forEach((final File file) {
_logger.fine(" Found: ${file}");
callback(file);
});
}
View
1 ex.sh

This file was deleted.

Oops, something went wrong.
@@ -56,7 +56,7 @@ class L10NImpl implements L10N {
}
Map<String, dynamic> toJson() {
final Map map = new Map<String, dynamic>();
final Map<String, dynamic> map = new Map<String, dynamic>();
Map<String,dynamic> convertVarsToEncodableValues(final Map<String,dynamic> vars) {
final Map<String,dynamic> encodableVars = new Map<String, dynamic>();
@@ -95,10 +95,10 @@ class L10NImpl implements L10N {
Validate.notNull(data);
if(data is Map) {
return data;
return data as Map<String, dynamic>;
} else if(data is String) {
return JSON.decode(data);
return JSON.decode(data) as Map<String, dynamic>;
}
throw new ArgumentError("$data is not a valid basis for a JSON-Map. Data should be either a String or a Map but was ${data.runtimeType}");
View

This file was deleted.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 5532669

Please sign in to comment.