land

Last updated:

0 purchases

land Image
land Images
Add to Cart

Description:

land

LAND #

LAND is a powerful tool for generating localization files to be used in Dart applications, including Flutter apps. It supports complex ICU messages, works effectively even on non-Flutter applications, and offers multi-project support to simplify localization tasks in large codebases.

Requirements
Installation
Using LAND
Multi-Project Support
Configuration Example
Usage
Troubleshooting
Contributing
License


Requirements #

Dart version 2.16.1 or later.

Installation #
Install LAND globally on your system to use it from anywhere:
dart pub global activate land
copied to clipboard
Ensure the Dart SDK/bin is included in your PATH. If not, you will need to add it. The method varies depending on your operating system.
On Linux or macOS, add it to your shell profile (e.g., ~/.bashrc, ~/.bash_profile, or ~/.zshrc). On Windows, add it via the System Properties.

Using LAND #
LAND can be used as an alternative to flutter gen-l10n. Here are the steps to follow:

Update your localization configuration file to specify only the output folder, not the output localization file.
Rename your configuration file from l10n.yaml to land.yaml.
Remove the generate: true flag from your pubspec.yaml file.
Add /lib/.gen/ to your .gitignore file to ignore the generated files.
Install LAND globally using the installation instructions above.
Run land to generate the localization files.

After these steps, you should have a robust localization system set up for your Dart application.

Multi-Project Support #
One of the standout features of LAND is its support for multi-project localization. If you run LAND in a directory that isn't a Dart or Flutter project, it automatically searches for Dart or Flutter projects one level down from the current directory. This means you can generate localization files for all projects within a directory by running a single land command. This functionality is especially beneficial in monorepo setups or when managing multiple related projects.
To use this feature, simply navigate to the parent directory of your projects and run:
land
copied to clipboard
Or specify the parent directory using the --path argument like:
land --path <parent-directory>
copied to clipboard
LAND takes care of the rest, generating localization files for each Dart or Flutter project in the directory.

Configuration Example #
Create a configuration file named land.yaml and place it in the root directory of your project:
arb-dir: l10n
template-arb-file: l10n_en.arb
output-directory: lib/.gen/l10n/
output-class: L10N
copied to clipboard

Usage #
Create a folder named l10n in the root directory of your application (outside lib), and add your language files there. Here are a couple of examples:
l10n/l10n_en.arb
{
"helloWorld": "Hello World!",
"@helloWorld": {}
}
copied to clipboard
l10n/l10n_pt.arb
{
"helloWorld": "Olá mundo!"
}
copied to clipboard
After running land, all the localization files will be generated and ready for use.

Troubleshooting #
If you encounter any issues while using LAND, please open an issue on our GitHub repository.

Contributing #
We welcome contributions! If you'd like to contribute, feel free to open a pull request.

License #
This project is licensed under the BSD-3-Clause License.

Thanks for using LAND!

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.