Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Feature request: Special language tag to retrieve raw (i.e. untranslated) text #133
Originally posted here: https://wordpress.org/support/topic/special-tag-to-get-raw-untranslated-text
Let me first explain the usage scenario:
This would allow me to put the posts directly into the front site and have translations work. The only requisite for this to work is that the main site has activated support for all languages that the sub groups may use.
I am not sure if this should be available for any page and post, or just for the news feed... I see no harm in having it available for all page types, but it should not be selectable from the language switcher, as it would look weird and not be friendly to human readers.
If I go to http://example.com/no/feed/ I would get content like
Title: Dette er en fin post
If I go to http://example.com/en/feed I would get content like
Title: This is a nice post
If I go to http://example.com/raw/feed I would get content like
Title: [:no]Dette er en fin post[:en]This is a nice post[:]
This will allow me to import the news feed http://example.com/raw/feed to a site that uses qTranslate and just plug it in to a new post and qTranslate will then show the right content in either Norwegian or English.
It is indeed a good idea, which we should implement, but I am not sure on the priority of it. Can you read PHP code? Would you be able to implement it and submit pull request here? We will need to finalize the details. Since the language code is essentially designed to be two-letter, it will be a bit challenging to use three-letter special code 'raw'. I am afraid it will generate too many additional 'if' statements. Maybe it would be better to use a special query argument?
Could you please try the latest version https://github.com/qTranslate-Team/qtranslate-x/archive/126.96.36.199.5.zip? Use query argument 'qtranslate-mode=raw' to retrieve untranslated pages.
This worked excellently. It grabbed the raw text and put it into the post on the main page. Now all languages used on our sub pages will show correctly on the main page.
I had to use http://example.com/feed/?qtranslate-mode=raw without the prepath (http://example.com/en/feed/?qtranslate-mode=raw) to get it to work properly, though. So it would be good if you could ignore path (and probably domain) prefixes when qtranslate-mode=raw.
Thank you for this quick fix.