Skip to content

Commit

Permalink
chore: Separate translation features into df_config library
Browse files Browse the repository at this point in the history
  • Loading branch information
robmllze committed Aug 22, 2024
1 parent c69c463 commit 0c8722b
Show file tree
Hide file tree
Showing 15 changed files with 73 additions and 20 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
##
## Dart/Flutter (DF) Packages by DevCetra.com & contributors. Use of this
## source code is governed by an MIT-style license that can be found in the
## LICENSE file.
## source code is governed by an an MIT-style license that can be found in the
## LICENSE file located in this project's root directory.
##
## For more about publishing, see: https://dart.dev/tools/pub/automated-publishing
## A workflow that publishes a Dart package to pub.dev. For more about
## publishing, see: https://dart.dev/tools/pub/automated-publishing
##
## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
##.title~
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
##
## Dart/Flutter (DF) Packages by DevCetra.com & contributors. Use of this
## source code is governed by an MIT-style license that can be found in the
## LICENSE file.
## source code is governed by an an MIT-style license that can be found in the
## LICENSE file located in this project's root directory.
##
## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
##.title~
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# DF Config
# DF - Config

<a href="https://www.buymeacoffee.com/robmllze" target="_blank"><img align="right" src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>

Expand Down
4 changes: 2 additions & 2 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
##
## Dart/Flutter (DF) Packages by DevCetra.com & contributors. Use of this
## source code is governed by an MIT-style license that can be found in the
## LICENSE file.
## source code is governed by an an MIT-style license that can be found in the
## LICENSE file located in this project's root directory.
##
## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
##.title~
Expand Down
2 changes: 1 addition & 1 deletion lib/df_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
//.title~

/// A package that provides methods to load configuration data and access it at runtime.
library;
library df_config;

export 'src/_index.g.dart';
13 changes: 13 additions & 0 deletions lib/df_translate.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//.title
// ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
//
// Dart/Flutter (DF) Packages by DevCetra.com & contributors. SSee MIT LICENSE
// file in root directory.
//
// ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
//.title~

/// A package that provides methods to load configuration data and access it at runtime.
library df_translate;

export 'df_translate_src/_index.g.dart';
21 changes: 21 additions & 0 deletions lib/df_translate_src/_index.g.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//.title
// ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
//
// GENERATED BY DF GEN - DO NOT MODIFY BY HAND
// See: https://github.com/robmllze/df_gen
//
// ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
//.title~

// --- PUBLIC FILES ---
export 'tr_on_string_extension.dart';
export 'screen_tr.dart';
export 'locale_ref.dart';
export 'translation_manager.dart';
export 'translation_file_reader.dart';

// --- PRIVATE FILES (EXCLUDED) ---
// None found.

// --- GENERATED FILES (EXCLUDED) ---
// None found.
File renamed without changes.
18 changes: 18 additions & 0 deletions lib/df_translate_src/screen_tr.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//.title
// ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
//
// Dart/Flutter (DF) Packages by DevCetra.com & contributors. SSee MIT LICENSE
// file in root directory.
//
// ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
//.title~

import 'package:df_string/df_string.dart';

import 'tr_on_string_extension.dart';

// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

String screenTr(String input, String category, {Map<dynamic, dynamic> args = const {}}) {
return input.splitByLastOccurrenceOf('||').join('||$category.').tr(args: args);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

import 'package:df_collection/df_collection.dart';

import 'translation_manager.dart';

import '/src/_index.g.dart';

// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import 'package:path/path.dart' as p;

import '/src/_index.g.dart';
import 'translation_manager.dart';

// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

Expand Down
File renamed without changes.
10 changes: 3 additions & 7 deletions lib/src/_index.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,21 @@
// --- PUBLIC FILES ---
export 'managers/config_manager.dart';
export 'managers/file_config_manager.dart';
export 'managers/translation_manager.dart';
export 'utils/replace_data.dart';
export 'utils/config_file_type.dart';
export 'utils/recursive_replace.dart';
export 'utils/replace_patterns.dart';
export 'utils/src_to_data.dart';
export 'utils/parse_source_for_strings_and_comments.dart';
export 'utils/cf_on_string_x.dart';
export 'utils/extract_scopes.dart';
export 'utils/translation_file_reader.dart';
export 'extensions/tr_on_string_extension.dart';
export 'extensions/cf_on_string_extension.dart';
export 'configs/file_config.dart';
export 'configs/config.dart';
export 'refs/config_ref.dart';
export 'refs/locale_ref.dart';
export 'refs/config_file_ref.dart';

// --- PRIVATE FILES (EXCLUDED) ---
// None found.
// export '_index.g.dart';

// --- GENERATED FILES (EXCLUDED) ---
// export '_index.g.dart';
// None found.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import '/src/_index.g.dart';

// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

extension CfOnStringExtension on String {
extension CfOnStringX on String {
/// Maps the string to using the active config file.
T? cf<T>(
Config config, [
Expand Down
7 changes: 4 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
##
## Dart/Flutter (DF) Packages by DevCetra.com & contributors. Use of this
## source code is governed by an MIT-style license that can be found in the
## LICENSE file.
## source code is governed by an an MIT-style license that can be found in the
## LICENSE file located in this project's root directory.
##
## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
##.title~

name: df_config
description: A package that provides methods to load configuration data and access it at runtime.
version: 0.2.0
version: 0.2.1
repository: https://github.com/robmllze/df_config
funding:
- https://www.buymeacoffee.com/robmllze
Expand All @@ -31,6 +31,7 @@ environment:
dependencies:
df_collection: ^0.3.0
df_type: ^0.2.3
df_string: ^0.2.1
yaml: ^3.1.2
meta: ^1.15.0
equatable: ^2.0.5
Expand Down

0 comments on commit 0c8722b

Please sign in to comment.