TinyMCE Translation Checker, by Liron Newman
What is TMTC?
TinyMCE Translation Checker, or TMTC, is a utility for TinyMCE translators, to help them check their translations to see if they're complete and up-to-date with the latest version of TinyMCE, and also check some common syntax errors.
Requirements
For running:
- Windows Script 5.6 - Most systems already have this. If you keep your Windows up to date, it's already there, and if you don't, you have bigger problems. :)
For using:
- A version of TinyMCE, to which your translation will be compared. Note: This program reads the language file format used since TinyMCE 2, so don't try it on earlier versions. Not that I can think of a reason why anyone would...
- A set of language files you want to check. You can get a language pack from here and check if it's complete, and update it according to what TMTC says is missing, or you can make your own, according to instructions on TinyMCE's wiki.
Usage
To use this script, you should have a TinyMCE installation with both the built-in, English language files and your own language files in their right places, together in their folders, just like you would have them when you want to use them in TinyMCE.
Once your TinyMCE and your translation are there, you run the script like this:
[CScript.exe] tmtc.vbs <BasePath> <LangCode> [MatchAgainst]
Where:
BasePath - The path all language files are stored under, usually the TinyMCE folder
LangCode - The language code for your translation, like en, it, hu, he, ja_utf-8...
MatchAgainst - Optional: The language to match against. Defaults to English (en) for obvious reasons
If your language code is "XX", and your TinyMCE folder is "tinymce" under the same folder as the script, you probably want to run it like this:
tmtc.vbc tinymce xx
When the check is done, Notepad will open with the results. If the script runs for a long time, or you want to see the results "live" for any reason, you can run it under the console (cmd.exe), like this:
cscript tmtc.vbc tinymce xx
or, if you want to redirect the results to somefile.txt:
cscript tmtc.vbc tinymce xx >somefile.txt
The results
In your results, you can get several types of messages:
- * ERROR: <path>\xx.js is missing! - This means that you forgot to translate a file. Create the missing xx.js and translate its strings.
- * WARNING: <path>\xx.js has no matching en.js. Check if it is necessary for this version of TinyMCE. - This is only a warning, and can be ignored, but what it means is that you have an "extra" file, that has no corresponding English language file (Assuming you check against the English files, which is the reasonable thing to do). This is usually because of a change in TinyMCE that removed the old language file, perhaps moving its contents to other files (You'll see if that is the case in other messages). This file probably won't be used, you should consider removing it (But make sure first!).
- * ERROR: <path>\xx.js addToLang value doesn't match en.js - In one on the first lines of the language file, you'll find the addToLang function call. Its first parameter should match the original language file.
- * ERROR: <path>\xx.js misses the 'some_text' string found in en.js - This means you forgot to translate one of the strings. Find the line starting with some_text in en.js, and copy it to your xx.js for translation.
- * ERROR: <path>\xx.js misses a comma after the 'some_text' string (At the end of the line). This will cause Javascript errors and will not work." - Just what it says. Add a comma (",").
- * ERROR: <path>\xx.js has a comma after the last string. This will cause Javascript errors and will not work. - Again, just what it says. The last string should not have a comma after it.
Download
The latest version is 1.0. Get it here:
Get TMTC 1.0
Changelog
License
TMTC is free to use, AT YOUR OWN RISK! I am not responsible for any kind of damage or bad thing that may happen to you, your computer, your data, or anything else in the universe, which has anything to do with this site or this program, directly or indirectly. If you're unsure, don't use it. If you distribute it or build anything upon it, give me credit, and tell me. Have fun!