Skip to content

Commit

Permalink
Fix formating
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Schubert committed Nov 19, 2014
1 parent 4aea6aa commit febf8c3
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions GettextTranslator/Gettext.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,12 @@ public function translate($message, $form = 1)

if (!empty($message) && isset($this->dictionary[$message]))
{
$tmp = preg_replace('/([a-z]+)/', '$$1', "n=$form;" . $this->metadata[$files[0]]['Plural-Forms']);
eval($tmp);
$pluralForms = $this->metadataList['Plural-Forms'];
if (isset($this->metadata[$files[0]]['Plural-Forms'])) {
$pluralForms = $this->metadata[$files[0]]['Plural-Forms'];
}
$tmp = preg_replace('/([a-z]+)/', '$$1', "n=$form;" . $pluralForms);
eval($tmp);

$message = $this->dictionary[$message]['translation'];
if (!empty($message))
Expand Down Expand Up @@ -379,13 +383,13 @@ public function getVariantsCount()
{
$this->loadDictonary();
$files = array_keys($this->files);
$plural_forms = $this->metadata_list['Plural-Forms'];
$pluralForms = $this->metadataList['Plural-Forms'];
if (isset($this->metadata[$files[0]]['Plural-Forms']))
{
$plural_forms = $this->metadata[$files[0]]['Plural-Forms'];
$pluralForms = $this->metadata[$files[0]]['Plural-Forms'];
}

return (int)substr($plural_forms, 9, 1);
return (int)substr($pluralForms, 9, 1);
}

/**
Expand Down

0 comments on commit febf8c3

Please sign in to comment.