Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write script for CSV to JSON in other programming languages #3

Open
2 of 3 tasks
thealphadollar opened this issue Sep 19, 2020 · 11 comments
Open
2 of 3 tasks

Write script for CSV to JSON in other programming languages #3

thealphadollar opened this issue Sep 19, 2020 · 11 comments
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest help wanted Extra attention is needed javascript node shellscript

Comments

@thealphadollar
Copy link
Owner

thealphadollar commented Sep 19, 2020

Currently, the script to convert the language CSV to multiple language JSON files is written in Python3. This poses an issue of installing Python3 for web developers who want to use the library for providing internationalization.

The script should be ported to the following languages for ease of usage:

An enhanced version of the same would be developing a tiny webpage that takes the CSV as input and provides the JSON for the corresponding languages.

@toyamarodrigo
Copy link
Contributor

hey @thealphadollar I wonder if you you check #5 PR?
I want to know if it meets the requeriments for this issue 😄
Thanks!

@thealphadollar
Copy link
Owner Author

@toyamarodrigo Hey, I'm a bit busy over the week and will be looking at it as soon as I get time. I'm really thankful for your contribution and patience :D

thealphadollar added a commit that referenced this issue Oct 8, 2020
Co-authored-by: Shivam Kumar Jha <shivam.cs.iit.kgp@gmail.com>
@NeerajGartia21
Copy link

Can I work on this issue?

@thealphadollar
Copy link
Owner Author

thealphadollar commented Jan 4, 2022

Yes, please.

Please let me know what language are you going to write the script for.

@NeerajGartia21
Copy link

I'm writing the script in JavaScript.

@thealphadollar
Copy link
Owner Author

thealphadollar commented Jan 5, 2022

Hey Neeraj! I appreciate your interest. We already have the NodeJS script. You can use it as a reference and prepare a JS script that is completely runnable in a browser.

Please also let me know if you research and find out the same is not possible.

@thealphadollar
Copy link
Owner Author

I mistook the NodeJS script for JS. I've edited my comment. Apologies.

@NeerajGartia21
Copy link

Ok I will research on this :)

What are the other languages that I can use for writting the script.

@thealphadollar
Copy link
Owner Author

Any language is fine - GoLang, Rust, Php, etc. Wherever it is possible should be a good language.

@IsmaCortGtz
Copy link
Contributor

IsmaCortGtz commented Aug 21, 2023

I'm working in a JS version runnable in the browser. Currently, it works perfectly. This is the example of the usage:

const CSV_CONFIG = {
  double_quotationmark: true,
  lastbeggin_quotationmark: true,
  delimiter: ",",
  breakline: "\r\n"
}

var csvParser = new csv2vi18n(myCsvText, CSV_CONFIG);

csvParser.languages  // Array of available languages
csvParser.getLanguageObject("Enlgish");  // Return Object of language if exists
csvParser.getSingleLanguageJson("Enlgish");  // Download JSON file of language
csvParser.downloadZip();  // Download all languages in Zip file

/*  

File structure of zip file:

  vanilla-i18n
  ├── English.json
  ├── français.json
  └── हिन्दी.json

*/

It needs the JSZip to work. The current version uses a small csv parser that I wrote, but I wish to change for jquery-csv soon.
The HTML file header looks like this:

<!-- <script src="./jquery.csv.min.js"></script>. //Not yet -->
<script src="./jszip.min.js"></script>
<script src="./csv_to_vanilla_i18.browser.js"></script>

The reason why I didn't open a PR yet is because I don't know how to serve that. We should deploy it in the gh-pages?

You can check my implementation here in my fork, you need to pull it to your local repo and open the HTML file in your browser with file://.

My repo added a lot of code, but the script is just in this file, the others are for an HTML deploy.

PD: I'm not a native English speaker. Sorry if my redaction is confusing. 😅

@thealphadollar
Copy link
Owner Author

Ah! Looks amazing.

We should deploy it in the gh-pages?

Yes, that would be best.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest help wanted Extra attention is needed javascript node shellscript
Projects
None yet
Development

No branches or pull requests

4 participants