Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
samgeorges committed Oct 16, 2022
1 parent 75ec23b commit f148ccf
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ Beginning from October CMS v3.1, a multisite feature was introduced that superce

## Breaking Changes

### `Locale` model is replaced
### Locale model is replaced

Since there is no Languages settings page, there is no `RainLab\Translate\Models\Locale` model to match it. The model has been replaced by the `RainLab\Translate\Classes\Locale` class instead and offers equivalent functionality. It acts as an adapter to the global `Site` helper class.
Since there is no Languages settings page, the `RainLab\Translate\Models\Locale` model is replaced by the `RainLab\Translate\Classes\Locale` class.

### Middleware class is replaced

Expand Down
30 changes: 15 additions & 15 deletions classes/ThemeScanner.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,21 @@ public function scanForMessages()
$this->scanMailTemplatesForMessages();
}

/**
* importMessages will import scanned messages, use withKeys if the messages
* also contain their translation key, e.g [my_code => My Code]
*/
public function importMessages($messages, $locale = null, $withKeys = false)
{
if (!$withKeys) {
$messages = array_combine($messages, $messages);
}

Message::importMessageCodes($messages, $locale);

$this->foundMessages += $messages;
}

/**
* getFoundMessages
*/
Expand Down Expand Up @@ -216,21 +231,6 @@ public function parseContent($content)
return $messages;
}

/**
* importMessages will import scanned messages, use withKeys if the messages
* also contain their translation key, e.g [my_code => My Code]
*/
public function importMessages($messages, $locale = null, $withKeys = false)
{
if (!$withKeys) {
$messages = array_combine($messages, $messages);
}

Message::importMessageCodes($messages, $locale);

$this->foundMessages += $messages;
}

/**
* Process standard language filter tag (_|)
* @param string $content
Expand Down
4 changes: 2 additions & 2 deletions models/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ public static function getMessages($locale = null, $options = [])
}

/**
* importMessages
* @deprecated use importMessageCodes with array_combine
* @deprecated use importMessageCodes with array_combine or
* the ThemeScanner class with importMessages method.
*/
public static function importMessages($messages, $locale = null)
{
Expand Down

0 comments on commit f148ccf

Please sign in to comment.