This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public function translateFile($lang) | |
| { | |
| $handle = fopen("/tmp/fr.yaml", "r"); | |
| $myfile = fopen("/tmp/".$lang.".yaml", "w") or die("Unable to open file!"); | |
| if ($handle && $myfile) { | |
| while (($line = fgets($handle)) !== false) { | |
| if (substr($line, 0, 1) === '#' || $line === '' || $line === '\r\n' || $line === '\r' || $line === '\n') { | |
| fwrite($myfile, $line); | |
| } | |
| else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| //my custom toUTC fonction -> convert date to yyyymmddThhiissZ format | |
| //date: YYYY-MM-DD | |
| //hours: 1200 for 12:00 | |
| //Z: "Z" or empty | |
| ClassMethod toUTC(date As %String, hours As %String, Z As %String) As %String | |
| { | |
| Quit $replace(date,"-","")_"T"_hours_"00"_$Get(Z,"") | |
| } | |
| */ |