Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
154eca8
Fix Language overrides
ThexXTURBOXx May 4, 2022
3b26150
Update analyzer
ThexXTURBOXx Oct 13, 2022
22fd4d6
Ignore pubspec.lock
ThexXTURBOXx Oct 23, 2022
172e632
Bump version
ThexXTURBOXx Oct 23, 2022
960ca97
Fix #90
ThexXTURBOXx Oct 23, 2022
2037d3c
Update changelog
ThexXTURBOXx Oct 23, 2022
cc6460a
Bump version
ThexXTURBOXx Nov 16, 2022
45bdb97
Add back disencouraged current instance
ThexXTURBOXx May 12, 2023
9323af8
Reorder
ThexXTURBOXx May 12, 2023
c3bacf2
Merge remote-tracking branch 'localizely/master'
ThexXTURBOXx Jun 13, 2023
4f26f6e
Merge remote-tracking branch 'localizely/master'
ThexXTURBOXx Aug 7, 2023
8dcdccd
Clean up Regex and allow new analyzer versions
ThexXTURBOXx Aug 7, 2023
91430c9
Merge remote-tracking branch 'localizely/master'
ThexXTURBOXx Oct 18, 2023
a8020fa
Merge remote-tracking branch 'localizely/master'
ThexXTURBOXx Nov 28, 2023
000a84a
Merge remote-tracking branch 'localizely/master'
ThexXTURBOXx Jan 12, 2024
1a3c8b0
Fix typo
ThexXTURBOXx Nov 3, 2024
c139123
Update intl and lints
ThexXTURBOXx Nov 27, 2024
e7b82da
Merge remote-tracking branch 'localizely/master'
ThexXTURBOXx Jan 9, 2025
6471cb6
Merge remote-tracking branch 'localizely/master'
ThexXTURBOXx Feb 21, 2025
00d3011
Merge remote-tracking branch 'localizely/master'
ThexXTURBOXx Sep 2, 2025
86b0861
Merge remote-tracking branch 'localizely/master'
ThexXTURBOXx Sep 24, 2025
f31802a
Merge remote-tracking branch 'localizely/master'
ThexXTURBOXx Jan 11, 2026
ef94e59
Update analyzer and lints and fix lint
ThexXTURBOXx Jan 22, 2026
d3e3ffc
Merge remote-tracking branch 'localizely/master'
ThexXTURBOXx Mar 4, 2026
46d9e95
Update analyzer dependency
ThexXTURBOXx Mar 18, 2026
cbe1cf0
Merge remote-tracking branch 'localizely/master'
ThexXTURBOXx Jun 17, 2026
c1c10cc
Reformat
ThexXTURBOXx Jun 17, 2026
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
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to the "flutter-intl" extension will be documented in this f
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 2.8.17 - Unreleased

- Fix language overrides ([#19](https://github.com/localizely/intl_utils/issues/19))

## 2.8.16 - 2026-06-11

- Update `analyzer` dependency
Expand Down Expand Up @@ -86,7 +90,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## 2.8.0 - 2022-11-15

- Update `analyzer` and `lints` dependencies
- Update `analyzer` and `lints` dependencies ([#91](https://github.com/localizely/intl_utils/issues/91))

## 2.7.0 - 2022-07-07

Expand Down
2 changes: 1 addition & 1 deletion bin/generate.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
library intl_utils;
library;

import 'package:intl_utils/intl_utils.dart';
import 'package:intl_utils/src/generator/generator_exception.dart';
Expand Down
2 changes: 1 addition & 1 deletion bin/localizely_download.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
library intl_utils;
library;

import 'dart:io';

Expand Down
2 changes: 1 addition & 1 deletion bin/localizely_upload_main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
library intl_utils;
library;

import 'dart:io';

Expand Down
2 changes: 1 addition & 1 deletion lib/intl_utils.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
library intl_utils;
library;

export 'src/generator/generator.dart';
7 changes: 3 additions & 4 deletions lib/src/config/credentials_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ class CredentialsConfig {
);
}

_apiToken =
credentialsYaml['api_token'] is String
? credentialsYaml['api_token']
: null;
_apiToken = credentialsYaml['api_token'] is String
? credentialsYaml['api_token']
: null;
}

String? get apiToken => _apiToken;
Expand Down
113 changes: 49 additions & 64 deletions lib/src/config/pubspec_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,30 +32,24 @@ class PubspecConfig {
return;
}

_enabled =
flutterIntlConfig['enabled'] is bool
? flutterIntlConfig['enabled']
: null;
_className =
flutterIntlConfig['class_name'] is String
? flutterIntlConfig['class_name']
: null;
_mainLocale =
flutterIntlConfig['main_locale'] is String
? flutterIntlConfig['main_locale']
: null;
_arbDir =
flutterIntlConfig['arb_dir'] is String
? flutterIntlConfig['arb_dir']
: null;
_outputDir =
flutterIntlConfig['output_dir'] is String
? flutterIntlConfig['output_dir']
: null;
_useDeferredLoading =
flutterIntlConfig['use_deferred_loading'] is bool
? flutterIntlConfig['use_deferred_loading']
: null;
_enabled = flutterIntlConfig['enabled'] is bool
? flutterIntlConfig['enabled']
: null;
_className = flutterIntlConfig['class_name'] is String
? flutterIntlConfig['class_name']
: null;
_mainLocale = flutterIntlConfig['main_locale'] is String
? flutterIntlConfig['main_locale']
: null;
_arbDir = flutterIntlConfig['arb_dir'] is String
? flutterIntlConfig['arb_dir']
: null;
_outputDir = flutterIntlConfig['output_dir'] is String
? flutterIntlConfig['output_dir']
: null;
_useDeferredLoading = flutterIntlConfig['use_deferred_loading'] is bool
? flutterIntlConfig['use_deferred_loading']
: null;
_localizelyConfig = LocalizelyConfig.fromConfig(
flutterIntlConfig['localizely'],
);
Expand Down Expand Up @@ -94,50 +88,41 @@ class LocalizelyConfig {
return;
}

_projectId =
localizelyConfig['project_id'] is String
? localizelyConfig['project_id']
: null;
_branch =
localizelyConfig['branch'] is String
? localizelyConfig['branch']
: null;
_uploadAsReviewed =
localizelyConfig['upload_as_reviewed'] is bool
? localizelyConfig['upload_as_reviewed']
: null;
_uploadOverwrite =
localizelyConfig['upload_overwrite'] is bool
? localizelyConfig['upload_overwrite']
: null;
_uploadTagAdded =
localizelyConfig['upload_tag_added'] is yaml.YamlList
? List<String>.from(localizelyConfig['upload_tag_added'])
: null;
_uploadTagUpdated =
localizelyConfig['upload_tag_updated'] is yaml.YamlList
? List<String>.from(localizelyConfig['upload_tag_updated'])
: null;
_uploadTagRemoved =
localizelyConfig['upload_tag_removed'] is yaml.YamlList
? List<String>.from(localizelyConfig['upload_tag_removed'])
: null;
_downloadEmptyAs =
localizelyConfig['download_empty_as'] is String
? localizelyConfig['download_empty_as']
: null;
_projectId = localizelyConfig['project_id'] is String
? localizelyConfig['project_id']
: null;
_branch = localizelyConfig['branch'] is String
? localizelyConfig['branch']
: null;
_uploadAsReviewed = localizelyConfig['upload_as_reviewed'] is bool
? localizelyConfig['upload_as_reviewed']
: null;
_uploadOverwrite = localizelyConfig['upload_overwrite'] is bool
? localizelyConfig['upload_overwrite']
: null;
_uploadTagAdded = localizelyConfig['upload_tag_added'] is yaml.YamlList
? List<String>.from(localizelyConfig['upload_tag_added'])
: null;
_uploadTagUpdated = localizelyConfig['upload_tag_updated'] is yaml.YamlList
? List<String>.from(localizelyConfig['upload_tag_updated'])
: null;
_uploadTagRemoved = localizelyConfig['upload_tag_removed'] is yaml.YamlList
? List<String>.from(localizelyConfig['upload_tag_removed'])
: null;
_downloadEmptyAs = localizelyConfig['download_empty_as'] is String
? localizelyConfig['download_empty_as']
: null;
_downloadIncludeTags =
localizelyConfig['download_include_tags'] is yaml.YamlList
? List<String>.from(localizelyConfig['download_include_tags'])
: null;
? List<String>.from(localizelyConfig['download_include_tags'])
: null;
_downloadExcludeTags =
localizelyConfig['download_exclude_tags'] is yaml.YamlList
? List<String>.from(localizelyConfig['download_exclude_tags'])
: null;
_otaEnabled =
localizelyConfig['ota_enabled'] is bool
? localizelyConfig['ota_enabled']
: null;
? List<String>.from(localizelyConfig['download_exclude_tags'])
: null;
_otaEnabled = localizelyConfig['ota_enabled'] is bool
? localizelyConfig['ota_enabled']
: null;
}

String? get projectId => _projectId;
Expand Down
66 changes: 33 additions & 33 deletions lib/src/generator/generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,35 +119,35 @@ class Generator {
var content = mainArbFile.readAsStringSync();
var decodedContent = json.decode(content) as Map<String, dynamic>;

var labels =
decodedContent.keys.where((key) => !key.startsWith('@')).map((key) {
var name = key;
var content = decodedContent[key];

var meta = decodedContent['@$key'] ?? {};
var type = meta['type'];
var description = meta['description'];
var placeholders =
meta['placeholders'] != null
? (meta['placeholders'] as Map<String, dynamic>).keys
.map(
(placeholder) => Placeholder(
key,
placeholder,
meta['placeholders'][placeholder],
),
)
.toList()
: null;

return Label(
name,
content,
type: type,
description: description,
placeholders: placeholders,
);
}).toList();
var labels = decodedContent.keys.where((key) => !key.startsWith('@')).map((
key,
) {
var name = key;
var content = decodedContent[key];

var meta = decodedContent['@$key'] ?? {};
var type = meta['type'];
var description = meta['description'];
var placeholders = meta['placeholders'] != null
? (meta['placeholders'] as Map<String, dynamic>).keys
.map(
(placeholder) => Placeholder(
key,
placeholder,
meta['placeholders'][placeholder],
),
)
.toList()
: null;

return Label(
name,
content,
type: type,
description: description,
placeholders: placeholders,
);
}).toList();

return labels;
}
Expand All @@ -156,10 +156,10 @@ class Generator {
var index = locales.indexOf(_mainLocale);
return index != -1
? [
locales.elementAt(index),
...locales.sublist(0, index),
...locales.sublist(index + 1),
]
locales.elementAt(index),
...locales.sublist(0, index),
...locales.sublist(index + 1),
]
: locales;
}

Expand Down
7 changes: 3 additions & 4 deletions lib/src/generator/intl_translation_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,9 @@ class BasicTranslatedMessage extends TranslatedMessage {
BasicTranslatedMessage(super.name, super.translated, this.messages);

@override
List<MainMessage>? get originalMessages =>
(super.originalMessages == null)
? _findOriginals()
: super.originalMessages;
List<MainMessage>? get originalMessages => (super.originalMessages == null)
? _findOriginals()
: super.originalMessages;

// We know that our [id] is the name of the message, which is used as the key in [messages].
List<MainMessage>? _findOriginals() => originalMessages = messages[id];
Expand Down
Loading