diff --git a/.github/workflows/prepare.yml b/.github/workflows/prepare.yml index db61594..28668b7 100644 --- a/.github/workflows/prepare.yml +++ b/.github/workflows/prepare.yml @@ -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~ diff --git a/.gitignore b/.gitignore index 88ebb3b..20c8ac7 100644 --- a/.gitignore +++ b/.gitignore @@ -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~ diff --git a/README.md b/README.md index b3f7532..02a2e43 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# DF Config +# DF - Config Buy Me A Coffee diff --git a/analysis_options.yaml b/analysis_options.yaml index 0a26d0b..234a52b 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -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~ diff --git a/lib/df_config.dart b/lib/df_config.dart index 7e5af1f..fa82c3a 100644 --- a/lib/df_config.dart +++ b/lib/df_config.dart @@ -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'; diff --git a/lib/df_translate.dart b/lib/df_translate.dart new file mode 100644 index 0000000..c4f5e9d --- /dev/null +++ b/lib/df_translate.dart @@ -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'; diff --git a/lib/df_translate_src/_index.g.dart b/lib/df_translate_src/_index.g.dart new file mode 100644 index 0000000..ae01545 --- /dev/null +++ b/lib/df_translate_src/_index.g.dart @@ -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. \ No newline at end of file diff --git a/lib/src/refs/locale_ref.dart b/lib/df_translate_src/locale_ref.dart similarity index 100% rename from lib/src/refs/locale_ref.dart rename to lib/df_translate_src/locale_ref.dart diff --git a/lib/df_translate_src/screen_tr.dart b/lib/df_translate_src/screen_tr.dart new file mode 100644 index 0000000..b4190e4 --- /dev/null +++ b/lib/df_translate_src/screen_tr.dart @@ -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 args = const {}}) { + return input.splitByLastOccurrenceOf('||').join('||$category.').tr(args: args); +} diff --git a/lib/src/extensions/tr_on_string_extension.dart b/lib/df_translate_src/tr_on_string_extension.dart similarity index 97% rename from lib/src/extensions/tr_on_string_extension.dart rename to lib/df_translate_src/tr_on_string_extension.dart index 04db6ee..54e8bd3 100644 --- a/lib/src/extensions/tr_on_string_extension.dart +++ b/lib/df_translate_src/tr_on_string_extension.dart @@ -9,6 +9,8 @@ import 'package:df_collection/df_collection.dart'; +import 'translation_manager.dart'; + import '/src/_index.g.dart'; // ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ diff --git a/lib/src/utils/translation_file_reader.dart b/lib/df_translate_src/translation_file_reader.dart similarity index 98% rename from lib/src/utils/translation_file_reader.dart rename to lib/df_translate_src/translation_file_reader.dart index 1824f3f..79ef3af 100644 --- a/lib/src/utils/translation_file_reader.dart +++ b/lib/df_translate_src/translation_file_reader.dart @@ -10,6 +10,7 @@ import 'package:path/path.dart' as p; import '/src/_index.g.dart'; +import 'translation_manager.dart'; // ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ diff --git a/lib/src/managers/translation_manager.dart b/lib/df_translate_src/translation_manager.dart similarity index 100% rename from lib/src/managers/translation_manager.dart rename to lib/df_translate_src/translation_manager.dart diff --git a/lib/src/_index.g.dart b/lib/src/_index.g.dart index 0f2308f..faf2694 100644 --- a/lib/src/_index.g.dart +++ b/lib/src/_index.g.dart @@ -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. \ No newline at end of file diff --git a/lib/src/extensions/cf_on_string_extension.dart b/lib/src/utils/cf_on_string_x.dart similarity index 96% rename from lib/src/extensions/cf_on_string_extension.dart rename to lib/src/utils/cf_on_string_x.dart index 93b4c4b..ba2f703 100644 --- a/lib/src/extensions/cf_on_string_extension.dart +++ b/lib/src/utils/cf_on_string_x.dart @@ -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( Config config, [ diff --git a/pubspec.yaml b/pubspec.yaml index 8d58320..1e8c607 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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 @@ -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