Gitzko
Gitzko

Reputation: 3

Copy language content to another

I'm on IP 4.0.11.

Is it possible to copy all content of a language to another (ie to edit only texts and not style or html)? Is there an option or perhaps in database?

Thanks in advance.

Upvotes: 0

Views: 199

Answers (2)

Roald
Roald

Reputation: 1

Thanks for answer, Audrius. This works fine with one caveat: The pages pasted into the new language still gets prepended with the old language's language prefix. Example: copied english page "home" to Norwegian and set the url to "hjem". The new page now got the url /en/hjem instead of no/hjem as expected. I'm on 4.0.16. Thankful for any hints.

Update May 21st: Did some debugging. Apparently there is nothing in the code of Ip\Internal\Pages copySinglePage() that cares about changing the $copy['languageCode'] for the new page to be inserted. Line 93 and onwards (referring to 4.0.16):

unset($copy['id']);
$copy['parentId'] = $newParentId;
$copy['pageOrder'] = $newIndex;
$copy['urlPath'] = UrlAllocator::allocatePath($copy['languageCode'], $copy['urlPath']);

whereas I'd also expect some logic setting

$copy['languageCode'] = something;

Hope this reaches the developers

Upvotes: 0

Audrius Jankauskas
Audrius Jankauskas

Reputation: 650

At this time you can only copy pages. In your case I'd do like this:

  1. Create a new language.
  2. Create same menus in new language (same name and alias).
  3. Then go to an original language.
  4. Select page (copying parent copies children, too)
  5. Click "copy" icon.
  6. Go to a new language.
  7. Select required menu.
  8. Click "paste" icon.
  9. Repeat 3-8.

It's a bit of manual work, but it's a fool-proof. It shouldn't take you very long. Changing a database may create many errors.

Upvotes: 1

Related Questions