Finished migration to use gettext (this now closes #161)

This commit is contained in:
Bernd Bestel
2019-05-02 20:20:18 +02:00
parent 5d3f248d94
commit 4912dd56d1
75 changed files with 2275 additions and 1581 deletions

View File

@@ -11,13 +11,13 @@ if ($db->quantity_units()->count() === 0)
{
// Create 2 default quantity units
$newRow = $db->quantity_units()->createRow(array(
'name' => $localizationService->Localize('Piece'),
'name_plural' => $localizationService->Localize('Pieces')
'name' => $localizationService->__n(1, 'Piece', 'Pieces'),
'name_plural' => $localizationService->__n(2, 'Piece', 'Pieces')
));
$newRow->save();
$newRow = $db->quantity_units()->createRow(array(
'name' => $localizationService->Localize('Pack'),
'name_plural' => $localizationService->Localize('Packs')
'name' => $localizationService->__n(1, 'Pack', 'Packs'),
'name_plural' => $localizationService->__n(2, 'Pack', 'Packs')
));
$newRow->save();
}
@@ -26,7 +26,7 @@ if ($db->locations()->count() === 0)
{
// Create a default location
$newRow = $db->locations()->createRow(array(
'name' => $localizationService->Localize('Fridge')
'name' => $localizationService->__t('Fridge')
));
$newRow->save();
}

View File

@@ -9,5 +9,5 @@ $db = $this->DatabaseService->GetDbConnection();
$defaultShoppingList = $this->Database->shopping_lists()->where('id = 1')->fetch();
$defaultShoppingList->update(array(
'name' => $localizationService->Localize('Shopping list')
'name' => $localizationService->__t('Shopping list')
));

2
migrations/0067.sql Normal file
View File

@@ -0,0 +1,2 @@
ALTER TABLE quantity_units
ADD plural_forms TEXT;