mikuli.cz

:)
git clone https://git.sr.ht/~ashymad/mikuli.cz
Log | Files | Refs

french.php (1056B)


      1 <?php
      2 // French extension, https://github.com/datenstrom/yellow-extensions/tree/master/languages/french
      3 // Copyright (c) 2013-2020 Datenstrom, https://datenstrom.se
      4 // This file may be used and distributed under the terms of the public license.
      5 
      6 class YellowFrench {
      7     const VERSION = "0.8.19";
      8     const TYPE = "language";
      9     public $yellow;         //access to API
     10     
     11     // Handle initialisation
     12     public function onLoad($yellow) {
     13         $this->yellow = $yellow;
     14     }
     15     
     16     // Handle update
     17     public function onUpdate($action) {
     18         $fileName = $this->yellow->system->get("coreSettingDir").$this->yellow->system->get("coreSystemFile");
     19         if ($action=="install") {
     20             $this->yellow->system->save($fileName, array("language" => "fr"));
     21         } elseif ($action=="uninstall" && $this->yellow->system->get("language")=="fr") {
     22             $language = reset(array_diff($this->yellow->text->getLanguages(), array("fr")));
     23             $this->yellow->system->save($fileName, array("language" => $language));
     24         }
     25     }
     26 }