Skip to content

Commit 988850c

Browse files
committed
Move initialization methods to init(), remove call to method that does not exist
1 parent 4496140 commit 988850c

File tree

3 files changed

+17
-24
lines changed

3 files changed

+17
-24
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Fluency for ProcessWire Changelog
22

3+
## 1.0.6 2023-12-26
4+
5+
### Bugfix, Internal Updates, Recommended for all users
6+
7+
- Move initializations to `init()` method so that Fluency can be used prior to `ready()` which to
8+
allow functionality to be extended beyond the page context. Allows Fluency to be accessed and
9+
used by other modules.
10+
- Removed call to previously removed method in module
11+
312
## 1.0.5 2023-12-22
413

514
### _Critical update_, Bugfix upgrade recommended for all users.

Fluency.info.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
$info = [
88
'title' => 'Fluency',
9-
'version' => '105',
9+
'version' => '106',
1010
'href' => 'https://processwire.com/talk/topic/24567-fluency-integrated-deepl-powered-content-translation',
1111
'icon' => 'language',
1212
'summary' => 'The complete translation enhancement suite for ProcessWire.',

Fluency.module.php

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -109,18 +109,18 @@ public function init() {
109109

110110
$this->moduleJsPath = "{$this->urls->$this}assets/scripts/";
111111
$this->moduleCssPath = "{$this->urls->$this}assets/styles/";
112-
}
113112

114-
/**
115-
* Executes module when PW is ready
116-
* @return void
117-
*/
118-
public function ready() {
119113
$this->fluencyConfig = (new FluencyConfig())->getConfigData();
120114
$this->translationCache = new TranslationCache();
121115
$this->engineLanguagesCache = new EngineLanguagesCache();
122116
$this->initializeTranslationEngine();
117+
}
123118

119+
/**
120+
* Executes admin UI when PW is ready
121+
* @return void
122+
*/
123+
public function ready() {
124124
if (!$this->moduleShouldInitInAdmin()) {
125125
return false;
126126
}
@@ -237,9 +237,7 @@ public function insertApiUsageTableFieldsetAssets(): void {
237237
* @return bool
238238
*/
239239
public function inputfieldTranslationIsReady(): bool {
240-
return $this->translationEngineIsReady() &&
241-
$this->getDefaultConfiguredLanguage() &&
242-
count($this->getConfiguredLanguages()) >= 2;
240+
return $this->translationEngineIsReady() && count($this->getConfiguredLanguages()) >= 2;
243241
}
244242

245243
/**
@@ -389,20 +387,6 @@ public function getUnconfiguredLanguages(): array {
389387
return $this->unconfiguredLanguages = array_values($unconfiguredLanguages);
390388
}
391389

392-
/**
393-
* Get the default language configured in Fluency.
394-
*
395-
* #pw-group-Fluency-Module-Configuration-Data
396-
*
397-
* @return ConfiguredLanguageData|null
398-
*
399-
* Reference `Fluency/app/DataTransferObjects/ConfiguredLanguageData.php`
400-
*/
401-
// public function getDefaultConfiguredLanguage(): ?ConfiguredLanguageData {
402-
// return $this->getConfiguredLanguages()->getDefault();
403-
// }
404-
405-
406390
/**
407391
* Gets all configuration data in one object. Can be passed into the ProcessWire JavaScript
408392
* config object

0 commit comments

Comments
 (0)