Coder Social home page Coder Social logo

canhcoco / csv-to-string-xml-android Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 20scoops-cnx/csv-to-string-xml-android

0.0 1.0 0.0 1.53 MB

convert file csv to format file string.xml android

License: Apache License 2.0

Shell 19.16% Python 80.84%

csv-to-string-xml-android's Introduction

csv2string-xml-android Build Status

Python scripts converting csv file to Android strings.xml resources multiple language ๐ŸŒˆ

string

Requirements

python version 3

To satisfy requirements, run the following command:

$ pip install lxml

If you are not using pip in a virtualenv and want to install lxml globally instead, you have to run the above command as admin, e.g. on Linux:

$ sudo pip install lxml

CSV Syntax

string

  • First line must have minimum 2 column [key | language-code]
  • Add # before string for comment message in strings.xml
  • Column arg is optional but if you provide it. It must be at last column
  • You can add multi column language code

file csv example

Usage

  1. Open Terminal ๐Ÿ˜‚

  2. Export path in your .bash_profile or .zshrc

    export PATH=$HOME/directory_your_download_this_project/csv-to-string-xml-android/bin:$PATH

  3. Go to your directory Android Project

    cd AndroidStudio/project_name

  4. Generating *.xml files multi language

    csv2xml

    Continue enter your path file csv in terminal

    Path to CSV file : "path-file-csv/csv-example.csv"

Output

...
app
โ””โ”€โ”€ src
    โ””โ”€โ”€ main
        โ””โ”€โ”€ res
            โ”œโ”€โ”€ values
            โ”‚ย ย  โ””โ”€โ”€ strings.xml
            โ””โ”€โ”€ values-de
            โ”‚   โ””โ”€โ”€ strings.xml
            โ””โ”€โ”€ values-ja
            โ”‚   โ””โ”€โ”€ strings.xml
            โ””โ”€โ”€ values-zh
                โ””โ”€โ”€ strings.xml

Reference

  • android-resource-converter by pwittchen link

License

Copyright 2017 Jedsada Tiwongvorakul

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

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.