smazat cach pro KdybyTranslation
- vosy
- Člen | 532
Ahoj, pouzivat KdybyTranslation.
mam cs a en verzi cs funguje dobre ale kdyz se prehodim na EN verzi tak se texty
nechteji nacist z app/lang
zobrazi se pouze: „header.inventory“
zapis v ms.en_US.neoun
header:
home: Home
inventory: Inventory
payment-terms: Payment terms
about-us: About us
contacts: Contacts
v template mam: {ms.header.inventory}
a promena $locale obsahuje spravne „en“
vubec netusim kde by mohla byt chybka, v error logu nic nemam :(
kdyz pridam jakoukoliv jinou jazykovou mutaci ru nebo de tak to funguje korektne.
Editoval vosy (3. 9. 2014 9:37)
- Filip Procházka
- Moderator | 4668
Screenshot panelu by pomohl. A obsah tvého configu, kde nastavuješ translator by pomohl.
- vosy
- Člen | 532
config.neon
#
# SECURITY WARNING: it is CRITICAL that this file & directory are NOT accessible directly via a web browser!
#
# If you don't protect this directory from direct web access, anybody will be able to see your passwords.
# https://nette.org/en/security-warning
#
common:
parameters:
php:
date.timezone: Europe/Prague
# zlib.output_compression: yes
nette:
application:
errorPresenter: Error
mapping:
*: App\*Module\Presenters\*Presenter
session:
expiration: 14 days
extensions:
translation: Kdyby\Translation\DI\TranslationExtension
services:
- Vosy\MyDb
- App\UrlTransform
- App\Model\CurrencyRepository
- App\RouterFactory
router: @App\RouterFactory::createRouter
translation:
default: en
whitelist: [en, cs] #....
fallback: [en_US, en]
debugger: on
resolvers:
session: on
Presenter
<?php
namespace App\Presenters;
use \Nette\Http\Url;
/**
* Base presenter for all application presenters.
*/
abstract class BasePresenter extends \Nette\Application\UI\Presenter
{
/** @persistent */
public $currency;
/** @persistent */
public $locale;
/** @var \Kdyby\Translation\Translator */
public $translator;
/**
* @var \Kdyby\Translation\LocaleResolver\SessionResolver
* @autowire
*/
protected $translatorSession;
public function injectTranslator(\Kdyby\Translation\Translator $translator)
{
$this->translator = $translator;
}
protected function createTemplate($class = NULL)
{
$template = parent::createTemplate($class);
$template->registerHelperLoader(callback($this->translator->createTemplateHelpers(), 'loader'));
return $template;
}
Router
$frontRouter[] = new Route('[<locale en|cs>_<currency czk|eur|usd>/]<presenter>/<action>/<id>',
array(
'locale' => 'en',
'currency' => 'eur',
'presenter'=>'Homepage',
'action'=>'default',
'id'=>NULL,
));
Editoval vosy (3. 9. 2014 12:55)
- Filip Procházka
- Moderator | 4668
V tom screenu je vidět, že se ti nenačetly žádné slovníky, jenom hlásí že se pokoušíš přeložit něco co neumí. Tedy problém hledej v načítání slovníků.
V jaké je máš složce? Určitě jsou v app/lang? smazal jsi celou temp/cache ?
- vosy
- Člen | 532
vypada to ze ano:
array (2)
header => array (5)
home => "Home" (4)
inventory => "Inventory" (9)
"payment-terms" => "Payment terms" (13)
"about-us" => "About us" (8)
contacts => "Contacts" (8)
footer => array (2)
designedBy => "Designed by Vosy.cz" (19)
allRights => "© 2014 DUTY FREE SLOVAKIA spol. s r.o.. All Rights Reserved. Designed by" (88)
zkousel jsem i prez composer znova nainstalovat kdyby/translation
ale stale stejny problem