Skip to content

Commit

Permalink
Merge pull request #23 from kenepa/quick-translate-offset
Browse files Browse the repository at this point in the history
Bugfix: Removed offset from QuickTranslate.php
  • Loading branch information
Jehizkia authored Oct 31, 2023
2 parents 24a0b4e + bc19ac9 commit 093b229
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/Pages/QuickTranslate.php
Original file line number Diff line number Diff line change
@@ -18,7 +18,6 @@ class QuickTranslate extends Page implements HasForms
protected static string $resource = LanguageLineResource::class;

public $selectedLocale = null;
public $offset = 0;
public $record;
public $totalLanguageLines;
public $enteredTranslation;
@@ -54,7 +53,6 @@ public function getForms(): array
->label(__('translation-manager::translations.quick-translate-select-locale'))
->reactive()
->afterStateUpdated(function ($state) {
$this->offset = 0;
$this->update();
}),
]),
@@ -87,7 +85,7 @@ public function saveAndContinue(): void
$this->enteredTranslation = '';

// Go to the next item
$this->next();
$this->update();
}

/**
@@ -96,21 +94,11 @@ public function saveAndContinue(): void
public function update(): void
{
$this->record = LanguageLine::whereNull('text->' . $this->selectedLocale)
->offset($this->offset)
->first();

$this->totalLanguageLines = LanguageLine::whereNull('text->' . $this->selectedLocale)->count();
}

/**
* Navigate to the next record.
*/
public function next(): void
{
$this->offset++;
$this->update();
}

/**
* Returns the title of the page.
*/

0 comments on commit 093b229

Please sign in to comment.