GithubHelp home page GithubHelp logo

seanghay / locale-parser Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 29 KB

Parse simple text as an Android XML Resource files powered by Vue.js, Vite.js and WindiCSS

Home Page: https://locale-parser.netlify.app/

License: Apache License 2.0

HTML 6.58% Vue 88.91% JavaScript 4.51%
android vue android-localization vitejs windicss

locale-parser's Introduction

Android Locale Parser

Parse simple text as an Android XML Resource files powered by Vue.js, Vite.js and WindiCSS

Basic Usage

This will generated each folder corresponding to the locale.

locale: Content
locale2: Content2
locale3: Content3

Output:

locale

<string name="">Content</string>

locale2

<string name="">Content2</string>

locale3

<string name="">Content3</string>

Headers

Keep our resource string tidy by specifying a header.

MainActivity

locale: Content
locale2: Content2
locale3: Content3

Output:

locale

<!-- [MainActivity] -->
<string name="">Content</string>

locale2

<!-- [MainActivity] -->
<string name="">Content2</string>

locale3

<!-- [MainActivity] -->
<string name="">Content3</string>

Resource Name

If you need to specify name for each item, you can use #hashtag. The hashtag can be placed anywhere in the header.

MainActivity #title_content_main

locale: Content
locale2: Content2
locale3: Content3

Output:

locale

<!-- [MainActivity] -->
<string name="title_content_main">Content</string>

locale2

<!-- [MainActivity] -->
<string name="title_content_main">Content2</string>

locale3

<!-- [MainActivity] -->
<string name="title_content_main">Content3</string>

Specify Output Files

In some cases, you might need to have different file name rather than strings.xml.

You can do that by using @file directive followed by the desired filename.

@file: my_file_name

en: English
km: ខ្មែរ

Result:

├── values
│   └── my_file_name.xml
└── values-km
    └── my_file_name.xml

2 directories, 2 files

locale-parser's People

Contributors

seanghay avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.