1

Folks:

I'm creating a localized site on Craft2 and CraftCommerce. I have followed the instructions for creating a localized site but none of the content shows at the localized URL and the homepage shows the craft default template. The default template has no content.

In the CP, the language is available in the upper right of an entry. The fields that are translatable are labelled. When I click the language, the Craft "not found" page is shown.

My guess is that because no fields exist for the language, no fields can be shown on the front end.

Error from the logs:

2019/02/22 11:28:37 [error] [exception.Craft\HttpException.404] Craft\HttpException in /usr/home/name/temp.domain.com/craft/app/controllers/EntriesController.php:773
Stack trace:
#0 /usr/home/name/temp.domain.com/craft/app/controllers/EntriesController.php(52): Craft\EntriesController->_prepEditEntryVariables(Array)
#1 [internal function]: Craft\EntriesController->actionEditEntry(Array)
#2 /usr/home/name/temp.domain.com/craft/app/framework/web/actions/CAction.php(109): ReflectionMethod->invokeArgs(Object(Craft\EntriesController), Array)
#3 /usr/home/name/temp.domain.com/craft/app/framework/web/actions/CInlineAction.php(47): CAction->runWithParamsInternal(Object(Craft\EntriesController), Object(ReflectionMethod), Array)
#4 /usr/home/name/temp.domain.com/craft/app/framework/web/CController.php(308): CInlineAction->runWithParams(Array)
#5 /usr/home/name/temp.domain.com/craft/app/framework/web/CController.php(286): CController->runAction(Object(CInlineAction))
#6 /usr/home/name/temp.domain.com/craft/app/framework/web/CController.php(265): CController->runActionWithFilters(Object(CInlineAction), Array)
#7 /usr/home/name/temp.domain.com/craft/app/framework/web/CWebApplication.php(282): CController->run('editEntry')
#8 /usr/home/name/temp.domain.com/craft/app/framework/web/CWebApplication.php(141): CWebApplication->runController('entries/editEnt...')
#9 /usr/home/name/temp.domain.com/craft/app/etc/web/WebApp.php(291): CWebApplication->processRequest()
#10 /usr/home/name/temp.domain.com/craft/app/framework/base/CApplication.php(185): Craft\WebApp->processRequest()
#11 /usr/home/name/temp.domain.com/craft/app/index.php(73): CApplication->run()
#12 /usr/home/name/temp.domain.com/public_html/index.php(20): require_once('/usr/home/name/...')
#13 {main}
REQUEST_URI=/admin/entries/contact/5-contact/en_gb
HTTP_REFERER=http://temp.domain.com/admin/entries/contact/5-contact

What I've done:

As mentioned, I've followed the instructions in the Craft docs.

I have updated the asset indexes.

I have used environment variables like so:

'temp.domain.com' => array(
        'environmentVariables' => array(
        'devMode' => true,
        'basePath' => '/usr/home/business/temp.domain.com/public_html/',
        'baseUrl'  => 'http://temp.domain.com/',
        ),
        'siteUrl' => array(
        'en_us' => 'http://temp.domain.com/',
        'en_gb' => 'http://temp.domain.com/en_gb',
        )
    ),

I have verified that asset source settings are:

{basePath}images_product/
{baseUrl}images_product/

I have made appropriate fields translatable.

I enabled the locales for each section.

I created and populated subfolders. Index.php looks like so:

// Path to your craft/ folder
$craftPath = '../../craft';

// Tell Craft to serve the British content
define('CRAFT_LOCALE', 'en_gb');

Additional info:

I am using SEOMatic and that does work as advertised with different meta content showing up for the localized site even if nothing else shows on the page.

  • For the CP side of things it looks like there's no 'contact' entry in your en_gb site. It regards to your templates, have you do followed the docs - docs.craftcms.com/v2/… – Oli Feb 24 '19 at 17:53
1

This turned out to be an issue with stalled tasks. There were a number of stalled tasks that were blocking the queue, preventing the localized pages from being created ("resave all localizable elements"). Clearing the stalled tasks resolved the issue. Thanks to Brad Bell for resolving this.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.