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

Add a Browser runnable version of CSV to JSON script. #13

Merged
merged 6 commits into from
Aug 23, 2023
Merged

Add a Browser runnable version of CSV to JSON script. #13

merged 6 commits into from
Aug 23, 2023

Conversation

IsmaCortGtz
Copy link
Contributor

@IsmaCortGtz IsmaCortGtz commented Aug 21, 2023

Add a Browser runnable version of CSV to JSON script

Ok, I guess I will open two PR now for the full deployment. This one should resolve one task of issue #3.

I added the final version of my script browser runnable in a folder because I want to add a minimum version too.

And obviously, I edited the README.md file to add some simple documentation.

This is how this script can be used:

const csvParser = new csv2vi18n(csv_text_plain, { separator: "," });

csvParser.getLanguages(); // Get an Array with languages name.
csvParser.getLanguageObject("français");  // Get the language Object in vanilla-i18n format.
csvParser.downloadLanguageJson("English");  // Download the language JSON in vanilla-i18n file format.
csvParser.downloadZip();  // Download ZIP with all languages in vanilla-i18n file format.

/*  
File structure of zip file:

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

To implement this script in your web you will need to import JSZip, JQuey and jquery-csv.

<script src="js/jquery.min.js"></script>
<script src="js/jquery.csv.min.js"></script>
<script src="js/jszip.min.js"></script>
<script src="js/csv_to_vanilla_i18n.browser.min.js"></script> <!-- This needs to be after the other ones. -->

@thealphadollar
Copy link
Owner

Thanks for the quick update, @IsmaCortGtz 🙏🏽 🎖️

@thealphadollar thealphadollar merged commit 3386fb9 into thealphadollar:master Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants