I'm trying to write a simple Windows Forms application to make translation of PHP based language files easier.
The forms application is pretty simple:
- Load PHP file
- Create C# array from php array (see below for PHP details)
- For each item in array display two boxes: Original + Translation
- User enters his translations in Box 2
- User clicks Next, Repeat Step 3+4
- User clicks Save, the translated array is saved to a new file.
The PHP file (language.php) is of the simplest nature:
<?php
$language['errormsg'] = 'This is my error message';
$language['forward'] = 'Forward';
$language['testing'] = 'Beta';
?>
How do I "convert" (parse) this simple PHP file into a C# array, DataSet or anything I can loop on?
Loading the file as a string via System.IO.File.ReadAllText is easy, I just don't know how to parse it in a smart way