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

Refactoring and improvements #52

Open
wants to merge 36 commits into
base: master
Choose a base branch
from

Conversation

marklagendijk
Copy link

@loudenvier I finally got some time to convert all the language files to .json. This pull requests contains the following (big) changes:

  1. All language files are converted to .json
  2. Gulp is added for building tasks. Both the .js files and demo files are automatically generated (see README.md)
  3. Added bower.json file, so the repository can be distributed via Bower.
  4. Updated README to reflect the above described changes.

Mark Lagendijk and others added 30 commits June 13, 2013 15:22
…US) and Dutch (nl-NL) locale.

The advantages of this format are:
- 1 object with all the labels. This object is in valid JSON format (quotes around propertynames). Because of this the object can be used directly in JSON resource files.
- Easier to read.
The translation of Clear for the filter was hard coded to "Cancelar" in
the demo.

I made this fix for English and Swedish in commit 7005ea2. This is for
the rest of the translations.

Also removing demo\swe.html which was added by mistake.
will likely broke  -> will likely brake
Svenska -> Swedish
This translation applicable for all Arabic cultures "ar"
Wrong 'GRID GROUP PANEL MESSAGES' translation.
Panamanian Spanish file for KendoUI localization.
new messages were added;
misprints in localization were corrected;
some of messages localizations were changed
Globalization up to v2013.3.1119
This reverts commit ccb535d.
joebordes and others added 6 commits February 1, 2014 00:48
- Converted all language files to .json
- Added gulpfile.js, which builds both the .js files and the demo files (see README.md).
- Added bower.json, so the package can be download via Bower (see README.md).
- Updated README.md.
- Converted all language files to .json
- Added gulpfile.js, which builds both the .js files and the demo files (see README.md).
- Added bower.json, so the package can be download via Bower (see README.md).
- Updated README.md.
This was referenced Feb 1, 2014
@loudenvier
Copy link
Owner

Nice work. Since I've got no idea what Gulp is, I'll have to consider if it will add any dependency to use the project. Currently all you have to do is to drop the needed JS, and I would like for this project to remain as simple as possible. So I'll weight the pros and cons of a JSON approach (I didn't actually looked at the changes to see how it works, I may not be making sense :-) )

@marklagendijk
Copy link
Author

I will explain a bit more about my changes, and also why I added Gulp and what it does.

The current approach of this project is nice when your application just uses one language. You just drop in the appropriate language file and you're done.
However, when you have to support multiple languages (especially if you're only using client-side code), this may become a problem. In cases like this you have to be able to dynamically load the right labels.
My changes are aimed at solving both problems, while still keeping it simple to contribute to the project, and maintain it:

  1. People should still be able to just drop in the right Javascript file and be done.
  2. When people need to be able to dynamically load the right labels, they should be able to do this.
  3. It should be easy to contribute translations to the project.
  4. It should be easy to maintain the project.

First of all, I transformed all the Javascript files to plain JSON files, such as this one.

Since, we still need the Javascript files, which load the labels of one particular language. The only way to keep this maintainable is to automate it. This is where Gulp comes in. Gulp is a node module aimed at automating development tasks like this. You use Gulp by writing a gulpfile, a NodeJS script which uses Gulp and Gulp plugins.
Here is the gulpfile, which I made for this project. It takes care of automatically generating the Javascript files, based on the JSON files, and of generating the right demo files. Since these generated files are also committed, people using the project don't need to do anything with Gulp. Only the people contributing the project have to use it, or even only the people maintaining the project.
Running the Gulp script is simple. I described it in the README.

Something which I still have to do is write a script (maybe as jQuery plugin) which can dynamically load and switch languages, by loading the JSON files (using jQuery).
I also want to add tests, so we can automatically verify which language files are incomplete. See also this issue.

@loudenvier
Copy link
Owner

Mark,
I'm working like a mad dog these past few months, that's why you great contribution isn't yet on the "official" repository... I've got to take a weekend to do the merge and digest this new (to me) technology, which is quite nice!

@marklagendijk
Copy link
Author

That's ok. I know the feeling ;).

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.