Skip to content

Commit

Permalink
release: 4.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Tienisto committed Dec 15, 2024
1 parent 1c7c5df commit fd736df
Show file tree
Hide file tree
Showing 15 changed files with 27 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .fvmrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"flutter": "3.24.5",
"flutter": "3.27.0",
"flavors": {}
}
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

env:
FLUTTER_VERSION_OLDEST: "3.19.6"
FLUTTER_VERSION_NEWEST: "3.24.5"
FLUTTER_VERSION_NEWEST: "3.27.0"

jobs:
format:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.24.5'
flutter-version: '3.27.0'
channel: 'stable'
- name: Dependencies (core)
run: flutter pub get
Expand Down
2 changes: 1 addition & 1 deletion slang/lib/src/api/translation_overrides.dart
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ extension TranslationOverridesStringExt on String {
});
}

/// Replaces every ${_root.<path>} with the real string
/// Replaces every `${_root.<path>}` with the real string
String applyLinks(TranslationMetadata meta, Map<String, Object> param) {
return replaceDartNormalizedInterpolation(replacer: (match) {
final nodeParam = match.substring(2, match.length - 1);
Expand Down
8 changes: 4 additions & 4 deletions slang/lib/src/builder/builder/translation_model_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class TranslationModelBuilder {

/// Builds the i18n model for ONE locale
///
/// The [map] must be of type Map<String, dynamic> and all children may of type
/// String, num, List<dynamic> or Map<String, dynamic>.
/// The [map] must be of type `Map<String, dynamic>` and all children may of type
/// `String`, `num`, `List<dynamic>` or `Map<String, dynamic>`.
///
/// If [baseData] is set and [BuildModelConfig.fallbackStrategy] is [FallbackStrategy.baseLocale],
/// then the base translations will be added to contexts where the translation is missing.
Expand Down Expand Up @@ -889,8 +889,8 @@ Set<InterfaceAttribute> _parseAttributes(ObjectNode node) {

/// Applies the generic type defined in the interface for all empty lists.
///
/// By default, empty lists are considered to be List<String>
/// But when interfaces are used, it can differ: e.g. List<MyType>
/// By default, empty lists are considered to be `List<String>`
/// But when interfaces are used, it can differ: e.g. `List<MyType>`
void _fixEmptyLists({
required ObjectNode node,
required Interface interface,
Expand Down
4 changes: 2 additions & 2 deletions slang/lib/src/builder/decoder/base_decoder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import 'package:slang/src/builder/model/enums.dart';

abstract class BaseDecoder {
/// Transforms the raw string (json, yaml, csv)
/// to a standardized map structure of Map<String, dynamic>
/// to a standardized map structure of `Map<String, dynamic>`
///
/// Children are Map<String, dynamic>, List<dynamic> or String
/// Children are `Map<String, dynamic>`, `List<dynamic>` or `String`
///
/// No case transformations, etc! Only the raw data represented as a tree.
Map<String, dynamic> decode(String raw);
Expand Down
7 changes: 1 addition & 6 deletions slang/lib/src/builder/generator/generate_translations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -608,12 +608,7 @@ void _generateList({
depth: depth + 1,
);
} else if (value is ObjectNode) {
// ignore: prefer_interpolation_to_compose_strings
final String key = r'$' '${listName ?? ''}\$' +
depth.toString() +
'i' +
i.toString() +
r'$';
final key = '\$${listName ?? ''}\$${depth.toString()}i${i.toString()}\$';
final String childClassNoLocale = getClassName(
base: base,
visibility: config.translationClassVisibility,
Expand Down
2 changes: 1 addition & 1 deletion slang/lib/src/builder/model/node.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ abstract interface class LeafNode {}

/// The super class for [ListNode] and [ObjectNode]
abstract class IterableNode extends Node {
/// The generic type of the container, i.e. Map<String, T> or List<T>
/// The generic type of the container, i.e. `Map<String, T>` or `List<T>`
String _genericType;

String get genericType => _genericType;
Expand Down
2 changes: 1 addition & 1 deletion slang/lib/src/builder/utils/map_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:collection/collection.dart';
import 'package:slang/src/builder/utils/node_utils.dart';

class MapUtils {
/// converts Map<dynamic, dynamic> to Map<String, dynamic> for all children
/// converts `Map<dynamic, dynamic>` to `Map<String, dynamic>` for all children
/// forcing all keys to be strings
static Map<String, dynamic> deepCast(Map<dynamic, dynamic> source) {
return source.map((key, value) {
Expand Down
2 changes: 1 addition & 1 deletion slang/lib/src/builder/utils/regex_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class RegexUtils {
RegExp(r'^((\w|\<|\>|,)+)(\?)? (\w+)(\(.+\))?$');

/// Matches the generic of the list
/// List<MyGeneric>
/// `List<MyGeneric>`
/// 1 - MyGeneric
static final RegExp genericRegex = RegExp(r'^List<((?:\w| |<|>)+)>$');

Expand Down
2 changes: 1 addition & 1 deletion slang/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: slang
description: Localization / Internationalization (i18n) solution. Use JSON, YAML, CSV, or ARB files to create typesafe translations via source generation.
version: 4.3.0
version: 4.4.0
repository: https://github.com/slang-i18n/slang
topics:
- i18n
Expand Down
4 changes: 4 additions & 0 deletions slang_build_runner/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 4.4.0

- bump `slang` to `4.4.0`

## 4.3.0

- bump `slang` to `4.3.0`
Expand Down
4 changes: 2 additions & 2 deletions slang_build_runner/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: slang_build_runner
description: build_runner integration for slang. This library ensures that slang is recognized by build_runner.
version: 4.3.0
version: 4.4.0
repository: https://github.com/slang-i18n/slang

environment:
Expand All @@ -12,7 +12,7 @@ dependencies:
glob: ^2.0.2

# Use a tight version to ensure that all features are available
slang: '>=4.3.0 <4.4.0'
slang: '>=4.4.0 <4.5.0'

dev_dependencies:
lints: any
4 changes: 4 additions & 0 deletions slang_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 4.4.0

- bump `slang` to `4.4.0`

## 4.3.0

- bump `slang` to `4.3.0`
Expand Down
4 changes: 2 additions & 2 deletions slang_flutter/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: slang_flutter
description: Flutter support for slang. This library provides helpful Flutter API.
version: 4.3.0
version: 4.4.0
repository: https://github.com/slang-i18n/slang

environment:
Expand All @@ -14,7 +14,7 @@ dependencies:
sdk: flutter

# Use a tight version to ensure that all features are available
slang: '>=4.3.0 <4.4.0'
slang: '>=4.4.0 <4.5.0'

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit fd736df

Please sign in to comment.