All Projects → gocal → gsheet_to_arb

gocal / gsheet_to_arb

Licence: other
Import translations (ARB/Dart) from Google Sheets

Programming Languages

dart
5743 projects

Projects that are alternatives of or similar to gsheet to arb

Luckysheet
Luckysheet is an online spreadsheet like excel that is powerful, simple to configure, and completely open source.
Stars: ✭ 9,772 (+46433.33%)
Mutual labels:  google-spreadsheet, google-sheets
ad localize
ADLocalize is a simple way to manage your localization files. Supported wording sources : CSVs and Google Sheets. Localization file generation available for iOS, Android, JSON (i18next), YAML and Java properties
Stars: ✭ 22 (+4.76%)
Mutual labels:  yaml, google-spreadsheet
google docs-ruby
A library which allows you to edit your spreadsheets with pleasure
Stars: ✭ 18 (-14.29%)
Mutual labels:  google-spreadsheet, google-sheets
multilanguages
AKSoftware.Localization.MultiLanguages is a package for .NET developers allows them to easily build apps target multiple languages with just few lines of code
Stars: ✭ 54 (+157.14%)
Mutual labels:  yaml
EnvCLI
Don't install Node, Go, ... locally - use containers you define within your project. If you have a new machine / other contributors you just have to install docker and envcli to get started.
Stars: ✭ 93 (+342.86%)
Mutual labels:  yaml
php-helpers
A Collection of useful php helper functions.
Stars: ✭ 26 (+23.81%)
Mutual labels:  yaml
snap2
Advanced tooling for puzzle hunts: grid/crossword parser, crossword tool to fill in the grid when entering answers, heavy-duty pattern/anagram solver, and more
Stars: ✭ 14 (-33.33%)
Mutual labels:  google-sheets
artefactory-connectors-kit
ACK is an E(T)L tool specialized in API data ingestion. It is accessible through a Command-Line Interface. The application allows you to easily extract, stream and load data (with minimum transformations), from the API source to the destination of your choice.
Stars: ✭ 34 (+61.9%)
Mutual labels:  google-sheets
yaask
Make your yaml configurable with interactive configurations!
Stars: ✭ 15 (-28.57%)
Mutual labels:  yaml
pystest
WEB UI自动化测试框架,selenium结合python,测试人员不需要会代码,只需要写配置即可实现,并且方便懂代码的测试人员扩展
Stars: ✭ 24 (+14.29%)
Mutual labels:  yaml
coAST
Universal and language-independent abstract syntax tree
Stars: ✭ 30 (+42.86%)
Mutual labels:  yaml
Slim-Config
A file configuration loader that supports PHP, INI, XML, JSON, and YML files for the Slim Framework. It internally uses https://github.com/hassankhan/config.
Stars: ✭ 28 (+33.33%)
Mutual labels:  yaml
odin
Data-structure definition/validation/traversal, mapping and serialisation toolkit for Python
Stars: ✭ 24 (+14.29%)
Mutual labels:  yaml
PasswordKeeper
Web-app to help you securely store your encrypted passwords in your Google Drive.
Stars: ✭ 43 (+104.76%)
Mutual labels:  google-sheets
Config
PHP library for simple configuration management
Stars: ✭ 39 (+85.71%)
Mutual labels:  yaml
read-yaml
Very thin wrapper around js-yaml for directly reading in YAML files.
Stars: ✭ 25 (+19.05%)
Mutual labels:  yaml
citybook
Create a resource directory from a contact spreadsheet.
Stars: ✭ 21 (+0%)
Mutual labels:  google-spreadsheet
Mosque-Screen
Chat: https://discord.gg/CG7frj2 - Email: [email protected]. We do not provide any support, this is a volunteer-based project therefore we cannot commit to any time to resolve local issues.
Stars: ✭ 54 (+157.14%)
Mutual labels:  google-sheets
ccxx
This is a cross-platform library software library about c, c ++, unix4, posix. Include gtest, benchmark, cmake, process lock, daemon, libuv, lua, cpython, re2, json, yaml, mysql, redis, opencv, qt, lz4, oci ... https://hub.docker.com/u/oudream
Stars: ✭ 31 (+47.62%)
Mutual labels:  yaml
tr4n5l4te
Use Google Translate without an API key.
Stars: ✭ 32 (+52.38%)
Mutual labels:  yaml

Import translations from Google Sheets

pub package

  • Import Application Resource Bundle (ARB) from Google Sheets
  • automatically create Dart intl classes
  • group translations by categories (context)
  • supports placeholders and plurals

Usage

Import Translation files from the Google Sheet

  1. Setup plugin configuration yaml file (you only need to do it once.)

  2. Import ARB and Dart source files from the Google Sheet

    pub run gsheet_to_arb:import
    

    or for flutter

    flutter pub run gsheet_to_arb:import
    

Setup

1. Create translation spreadsheet based on the template

2. Create Google Sheets API credentials either by using Client or Server authentication.

3. Configure your Dart project

  1. Add gsheet_to_arb dev dependency to the pubspec.yaml

    dev_dependencies:
      gsheet_to_arb: ^0.1.8
  2. Updated dependencies pub update

  3. Create plugin configuration

    pub run gsheet_to_arb:import --create-config
  • It will add plugin configuration to the pubspec.yaml file and create gsheet_to_arb.yaml authentication file for the gsheet credentials
  1. Update plugin configuration created in pubspec.yaml e.g.

    gsheet_to_arb: 
        arb_file_prefix: 'intl' # suffix of the created arb files e.g. intl_en.arb
        localization_file_name: 'l10n' # Genrated intl dart file name e.g. L10n.dart
        output_directory: 'lib/l10n' # where all the dart and arb data are stored
        add_context_prefix: false # should add category prefix to the keys e.g. common_app_title
        gsheet: 
            auth_file: './gsheet_to_arb.yaml' # file with the gsheet authentication configuration
            category_prefix: "# " 
            document_id: 'TODO'
            sheet_id: '0'
            columns: # This is an optional setting, if unused will fallback to default values
                key: 0 # The column where the key for the translation is, defaults to 0
                description: 1 # The column where the description is, defaults to 1
                first_language_key: 2 # The first column for the language copy, assumes that all other columns after this one also contains a language translation, defaults to 2
            rows: # This is an optional setting, if unused will fallback to default values
                header_row: 0 # The header row containing the title for each column, such as language codes, defaults to 0
                first_translation_row: 1 # The first row containing transaltions that should be parsed, assumes that all rows after this one also should be parsed, defaults 1
  2. Update gsheet authentication configuration created in gsheet_to_arb.yaml

  • either add client
    oauth_client_id: 
        client_id: "TODO"
        client_secret: "TODO"
  • or server credentials
    service_account_key: 
        client_id: "TODO"
        client_email: "TODO"
        private_key: "TODO"

Spreadsheet format

Rows

  • the first row is reserved for the header section and contains label of the related columns
  • other rows
    • if rows start with the category_prefix value (# default) all the following rows will use the category as a context (see: ARB context, and add_context_prefix parameter)
    • empty rows are ignored
    • rows with an empty key column are ignored

Columns

  • the first column key contains either key name or category prefix
  • the second column description contains item description
  • all the following column (language codes e.g. en, pl etc.) contains traslation files
  • will start parsing from the first language column and stop parsing on the last column or the first empty column, which ever comes first

Values

  • Placeholder

    • simply add {placeholder_name} to the translation
  • Plurals

    • plurals are identified by the key metadata - if key ends with one of the following
      • zero, one, two, few, many, other - it's considered as a plural
      • plural use special placeholder {count} to mark value provied as a translation parameter

TODO

  • support placeholder parameter types (e.g. int, date, text, double) - {items, int}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].