Git Product home page Git Product logo

propertyfilegenerator's Introduction

PropertyFileGenerator

This code repo contains Java Files which helps in generating property files in key value pairs for different languages

The idea is to take two files with names test.properties (for now) & test.txt and split the files using two delimiters. test.properties file will be splitted using "=" & test.txt will be splitted using "|" and add both of these to two different maps. Then call the method which process these maps further, for every value check if there is a value present in the key-value map. If there is a value then take the key from test.property file & combine it with the localized value of test.txt file. If it cannot find a value then it will simply add this to a notFoundList. Please go through the code & let me know if i can optimize this better. Please review the code & raise issues if i can do better.

I wrote this tool because i was exhausted doing internationalization for SAP CX (Hybris) project manually. I am not saying this will take care of everything but this will do the job better.

Example

  • user has an option to enter 1 or 2 on console based on their need.
  • if user enters 1 he / she needs to supply a property file in order to extract values from the file.
  • if user enters 2 then he / she needs to supply two files which are shown below.


test.properties

test.text.lang = Hello

test.txt

Hello|Bonjour

Notice that Bonjour means Hello in french.

Final output will look something like below

test.text.lang=Bonjour

Set up

  • step 1
    git clone https://github.com/rushendraChowdary/PropertyFileGenerator.git clone the repository or download the zip file from github

  • step 2
    Create the files with names mentioned(see Line no : 18, 19) in the PropertyFileGenerator.java or create new files with name of your choice and give the names in line number 18 & 19.
    Follow the example to create new files for best results.

  • Remember to use = for properties file & | for localized values.

  • finally run the main method, if everything goes well you will see a file with name file.properties under src folder with localized values in it.

SHOULD WORK ON

  • Limiting the file size
  • Optimizing the messy code
  • Should handle the exceptions really well
  • Work on a Spring web app to generate the replica & host it on HEROKU




Feel free to email me at [email protected] if you have any ideas to make this tool better.

Hack The Planet โœŒ๏ธ

propertyfilegenerator's People

Contributors

rushendrachowdary avatar deepsourcebot avatar

Watchers

 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.