Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
language: dart
dart:
- stable
- dev
6 changes: 3 additions & 3 deletions lib/extractor.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/*
* Copyright (c) 2018, Michael Mitterer (office@mikemitterer.at),
* IT-Consulting and Development Limited.
*
*
* All Rights Reserved.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
Expand Down
8 changes: 4 additions & 4 deletions lib/extractor/L10NMessageExtraction.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
Expand Down Expand Up @@ -156,7 +156,7 @@ class L10NFindingVisitor extends GeneralizingAstVisitor {
}

// e.g. l10n("Test 2 - Plural Name: {name}",{ "name" : "Mike" });
if(arguments.length == 2 && arguments.last is! MapLiteral) {
if(arguments.length == 2 && arguments.last is! SetOrMapLiteral) {
return false;
}

Expand Down Expand Up @@ -191,7 +191,7 @@ class L10NFindingVisitor extends GeneralizingAstVisitor {
_logger.shout("Unexpected exception: $e, $s");
throw L10NMessageExtractionException("Unexpected exception: $e, $s");
}

return false;
}

Expand All @@ -208,7 +208,7 @@ class L10NFindingVisitor extends GeneralizingAstVisitor {

final messageCode =
message.toOriginalCode(includeDesc: false, includeExamples: false);

if (existingCode != messageCode) {
extraction._makeWarning("WARNING: Duplicate message name:\n"
"'${message.name}' occurs more than once in ${extraction.origin}");
Expand Down
9 changes: 5 additions & 4 deletions lib/l10n.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
library l10n;

import "dart:collection";
import 'dart:async';
import 'dart:collection';
import 'dart:convert';
import 'package:intl/intl.dart';
import 'package:intl/date_symbol_data_local.dart';
Expand Down Expand Up @@ -34,18 +35,18 @@ String tr(final String msgid, [final Map<String, dynamic> vars = const {} ]) {
///
/// // Include this if you run your app in the browser
/// import 'package:intl/intl_browser.dart';
///
///
/// import 'package:l10n/l10n.dart';
/// import 'package:browser_example/_l10n/messages_all.dart';
///
///
/// Future main() async {
/// final String locale = await initLanguageSettings(
/// () => findSystemLocale(),
/// (final String locale) => initializeMessages(locale)
/// );
/// ...
/// }
///
///
Future<String> initLanguageSettings(
Future<String> findLocale(),
Future<bool> initMessages(final String locale)) async {
Expand Down
Loading