Skip to content

Commit

Permalink
Merge pull request #710 from balibali/t-4671
Browse files Browse the repository at this point in the history
(refs #4671, BP from #4668) SNS内名称設定で設定されている項目が翻訳されない場合がある
  • Loading branch information
nishizoe authored Jun 12, 2024
2 parents 20302d1 + 0204f75 commit 5f7458f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
4 changes: 0 additions & 4 deletions lib/config/opApplicationConfiguration.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,6 @@ public function filterTemplateParameters(sfEvent $event, $parameters)

$table = Doctrine::getTable('SnsTerm');
$application = sfConfig::get('sf_app');
if (in_array($application, array('pc_backend', 'api'), true))
{
$application = 'pc_frontend';
}
$table->configure(sfContext::getInstance()->getUser()->getCulture(), $application);
$parameters['op_term'] = $table;
sfOutputEscaper::markClassAsSafe('SnsTermTable');
Expand Down
4 changes: 0 additions & 4 deletions lib/i18n/opI18N.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ public function initialize(sfApplicationConfiguration $configuration, sfCache $c
parent::initialize($configuration, $cache, $options);

$application = sfConfig::get('sf_app');
if (in_array($application, array('pc_backend', 'api'), true))
{
$application = 'pc_frontend';
}
$this->terms = Doctrine::getTable('SnsTerm');
$this->terms->configure($this->culture, $application);
}
Expand Down
11 changes: 9 additions & 2 deletions lib/model/doctrine/SnsTermTable.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,21 @@ class SnsTermTable extends Doctrine_Table implements ArrayAccess

public function configure($culture = '', $application = '')
{
if ($culture)
if (in_array($application, array('pc_backend', 'api'), true))
{
$application = 'pc_frontend';
}

if ($culture && $culture !== $this->culture)
{
$this->culture = $culture;
$this->terms = null;
}

if ($application)
if ($application && $application !== $this->application)
{
$this->application = $application;
$this->terms = null;
}
}

Expand Down

0 comments on commit 5f7458f

Please sign in to comment.