Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit ddaeb7b

Browse files
author
Charles Ma
committed
ENH: refs #400 To re-enable internationalization -> core.ini
1 parent 66265c8 commit ddaeb7b

File tree

5 files changed

+46
-23
lines changed

5 files changed

+46
-23
lines changed

core/Bootstrap.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ protected function _initConfig()
5757
$configCore = new Zend_Config_Ini(CORE_CONFIG, 'global', true);
5858
Zend_Registry::set('configCore', $configCore);
5959

60+
// check if internationalization enabled
61+
if(isset($configCore->internationalization) && $configCore->internationalization == "0")
62+
{
63+
$configGlobal->application->lang = "en";
64+
}
65+
6066
$config = new Zend_Config_Ini(APPLICATION_CONFIG, $configGlobal->environment, true);
6167
Zend_Registry::set('config', $config);
6268
date_default_timezone_set($configGlobal->default->timezone);

core/configs/core.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ resources.frontController.controllerDirectory = "./core/controllers"
77
resources.frontController.moduleDirectory = "./modules"
88
resources.layout.layoutPath ="./core/layouts/"
99
resources.view.scriptPath = "./core/views/"
10+
internationalization = "0"
1011

1112
[testing]

core/layouts/layout.phtml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,13 @@ echo $this->doctype()
163163
<li>
164164
<a href="#" > <?= $this->t('Help') ?></a>
165165
</li>
166-
<li>
167166

167+
<?php
168+
if(!isset(Zend_Registry::get('configCore')->internationalization) || Zend_Registry::get('configCore')->internationalization == "1")
169+
{
170+
?>
171+
<li>
168172
<a href="#" style="margin-right: 20px">
169-
170173
<?php
171174
echo $this->t('My Language');
172175
?>
@@ -199,6 +202,9 @@ echo $this->doctype()
199202
</li>
200203
</ul>
201204
</li>
205+
<?php
206+
}
207+
?>
202208
</ul>
203209
</div>
204210
</div>
@@ -357,14 +363,14 @@ echo $this->doctype()
357363
<div style="display: none;" class="jsonContent">
358364
<?php echo $this->json?>
359365
</div>
360-
366+
361367
<div id="dialogStartingGuide" style="display:none;" title="<?php echo $this->t('Starting Guide')?>">
362368
<br/>
363369
Click on the action of you choice to start using the MIDAS Platform.
364-
370+
365371
<br/><br/>
366372
<div id="seperatorStartingGuide">
367-
373+
368374
</div>
369375
<br/>
370376
<div class="blockSet" id="blockPersoLink">
@@ -426,7 +432,7 @@ echo $this->doctype()
426432
</div>
427433
<br/>
428434
<div style="float:left;">
429-
<input type="checkbox" name="disableStartingGuide" id="disableStartingGuide" <?php if(isset($this->userDao) && $this->userDao->getDynamichelp() == 0) echo 'checked'?> />
435+
<input type="checkbox" name="disableStartingGuide" id="disableStartingGuide" <?php if(isset($this->userDao) && $this->userDao->getDynamichelp() == 0) echo 'checked'?> />
430436
<label style="color:grey;font-size: 11px;" for="disableStartingGuide">Always hide the help animation and this window.</label>
431437
</div>
432438
</div>

core/views/admin/index.phtml

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ $this->headScript()->appendFile($this->coreWebroot . '/public/js/jquery/jquery.c
2525
<li><a href="#tabs-configuration">Configuration</a></li>
2626
<li><a href="#tabs-modules">Modules</a></li>
2727
<li><a href="#tabs-assetstore">Assetstores</a></li>
28-
<li><a href="<?php echo $this->webroot?>/admin/upgrade">Upgrade</a></li>
29-
<li><a href="<?php echo $this->webroot?>/admin/dashboard">Dashboard</a></li>
28+
<li><a href="<?php echo $this->webroot?>/admin/upgrade">Upgrade</a></li>
29+
<li><a href="<?php echo $this->webroot?>/admin/dashboard">Dashboard</a></li>
3030
<li><a href="<?php echo $this->webroot?>/admin/showlog">Logs</a></li>
3131
</ul>
3232
<div id="tabs-configuration">
@@ -46,7 +46,12 @@ $this->headScript()->appendFile($this->coreWebroot . '/public/js/jquery/jquery.c
4646
<label for='name'>Keywords</label>
4747
{$this->configForm['keywords']}
4848
</div>
49-
<div class='installLang'>
49+
<div class='installLang'";
50+
if(isset(Zend_Registry::get('configCore')->internationalization) && Zend_Registry::get('configCore')->internationalization == "0")
51+
{
52+
echo " style='display:none;' ";
53+
}
54+
echo ">
5055
<label for='lang'>Language</label>
5156
{$this->configForm['lang']}
5257
</div>
@@ -120,7 +125,7 @@ $this->headScript()->appendFile($this->coreWebroot . '/public/js/jquery/jquery.c
120125
echo"</div>";
121126
}
122127
?>
123-
128+
124129
<a class="load-newassetstore" href="#newassetstore-form" rel="#newassetstore-form" title="<?php echo $this->t('Add a new assetstore')?>">Add a new assetstore</a>
125130
<br/>
126131
<a href="<?php echo $this->webroot?>/import" >Import local files</a>
@@ -129,7 +134,7 @@ $this->headScript()->appendFile($this->coreWebroot . '/public/js/jquery/jquery.c
129134
<?php echo $this->assetstoreForm; ?>
130135
</div>
131136
</div>
132-
137+
133138
<div id="tabs-modules">
134139
<table style='width:100%;'>
135140
<?php
@@ -146,11 +151,11 @@ $this->headScript()->appendFile($this->coreWebroot . '/public/js/jquery/jquery.c
146151
<tr class='moduleElement {$category}VisibleElement' style='display:none;'>
147152
<td style='width:30px;'>
148153
<input type='checkbox' dependencies='".trim($module->dependencies)."' class='moduleCheckbox' module='{$key}' name='module[{$key}]' ".((in_array($key, $this->modulesEnable))?'checked':'')."/>
149-
</td>
154+
</td>
150155
<td>
151156
<b>{$module->fullname}</b><br/>
152157
{$module->description}
153-
</td>";
158+
</td>";
154159
if($module->configPage)
155160
{
156161
echo "
@@ -167,7 +172,7 @@ $this->headScript()->appendFile($this->coreWebroot . '/public/js/jquery/jquery.c
167172
}
168173
?>
169174
</table>
170-
175+
171176
<table class="tableElementError" style="display:none;width:100%;">
172177
<?php
173178
$hidden = 0;
@@ -187,7 +192,7 @@ $this->headScript()->appendFile($this->coreWebroot . '/public/js/jquery/jquery.c
187192
<td>
188193
<b>{$module->fullname}</b><br/>
189194
{$module->description}
190-
</td>";
195+
</td>";
191196
if(!$module->dbOk)
192197
{
193198
echo "
@@ -211,20 +216,20 @@ $this->headScript()->appendFile($this->coreWebroot . '/public/js/jquery/jquery.c
211216
}
212217
?>
213218
</table>
214-
219+
215220
<?php if($hidden != 0)
216221
{
217222
echo "<br/><br/><a onclick=\"$('.tableElementError').show();$(this).remove();\">Show $hidden hidden modules</a>";
218223
}?>
219-
224+
220225
<p><a target="_blank" href="http://www.kitware.com/midaswiki/index.php/MIDAS3-Plugins">Additional Information</a></p>
221226
</div>
222227
</div>
223228

224229
</div>
225230
<div class="viewSideBar">
226-
227-
231+
232+
228233
</div>
229234

230235

core/views/install/step3.phtml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php
22
/*=========================================================================
33
MIDAS Server
44
Copyright (c) Kitware SAS. 20 rue de la Villette. All rights reserved.
@@ -34,7 +34,12 @@ PURPOSE. See the above copyright notices for more information.
3434
<label for='name'>Keywords</label>
3535
{$this->form['keywords']}
3636
</div>
37-
<div class='installLang'>
37+
<div class='installLang'";
38+
if(isset(Zend_Registry::get('configCore')->internationalization) && Zend_Registry::get('configCore')->internationalization == "0")
39+
{
40+
echo " style='display:none;' ";
41+
}
42+
echo ">
3843
<label for='lang'>Language</label>
3944
{$this->form['lang']}
4045
</div>
@@ -58,7 +63,7 @@ PURPOSE. See the above copyright notices for more information.
5863
{$this->form['submit']}
5964
</div>
6065
</form>";
61-
66+
6267
?>
6368
</div>
6469
<div class="viewSideBar">
@@ -71,7 +76,7 @@ PURPOSE. See the above copyright notices for more information.
7176
</div>
7277

7378
<div class='hiddenProcces' style="display:none;">
74-
<?php
79+
<?php
7580
echo "<br/>
7681
Windows:".BASE_PATH."<br/>/library/Executable/windows/32/<br/>wget.exe -O <br/>".BASE_PATH."<br/>/log/task.log<br/> http://localhost{$this->webroot}/task<br/><br/>
7782
Linux: wget -O ".BASE_PATH."<br/>/log/task.log http://localhost{$this->webroot}/task";

0 commit comments

Comments
 (0)