Plugin info

Total downloads: 352
Active installs: 0
Total reviews: 0
Average rating: 0
Support threads opened: 0
Support threads resolved: 0 (0%)
Available in: 1 language(s)
Contributors: 1
Last updated: 7/30/2022 (1250 days ago)
Added to WordPress: 7/30/2022 (3 years old)
Minimum WordPress version: f
Tested up to WordPress version: 6.0.9
Minimum PHP version: 7.4

Maintenance & Compatibility

Maintenance score

Possibly abandoned • Last updated 1250 days ago

20/100

Is LangBranch Shortcode abandoned?

Possibly abandoned (last update 1250 days ago).

Compatibility

Requires WordPress: f
Tested up to: 6.0.9
Requires PHP: 7.4

Languages

Similar & Alternatives

Explore plugins with similar tags, and compare key metrics like downloads, ratings, updates, support, and WP/PHP compatibility.

AI Translation for TranslatePress
Rating 4.8/5 (65 reviews)Active installs 10,000
SrbTransLatin – Serbian Latinisation
Rating 4.6/5 (38 reviews)Active installs 2,000
Ho YouDao Translate For TranslatePress
Rating 5.0/5 (1 reviews)Active installs 100
Hollisho Integration with DeepSeek for TranslatePress
Rating 5.0/5 (2 reviews)Active installs 70
TranslateX for TranslatePress
Rating 5.0/5 (1 reviews)Active installs 60
HHG for TranslatePress
Rating 0.0/5 (0 reviews)Active installs 60

Description

What is LangBranch

It’s a simple plugin enable you to use a shortcode like below to display correspond language version of content based on get_locale().
`php
[langbranch aio en_US=”English version” en_GB=”en_US” zh_TW=”中文版本” ja_JP=”日本語バージョン”]

[langbranch en_US]
Content here will only be displayed if get_locale() returns “en_US”.
[/langbranch]
[langbranch en_US zh_TW]
Content here will only be displayed if get_locale() returns “en_US” or “zh_TW”.
[/langbranch]
`

Motivation

I’ve been using TranslatePress to provide multi locale experience for visiters.
However, I had been suffering from losting translated content once I update original language’s content, until I decided to create a simple shortcode to solve this problem.

Usages

AIO (1-liner) Mode

“`php
[langbranch aio en_US=”English version” en_GB=”en_US” zh_TW=”中文版本” ja_JP=”日本語バージョン”]
By appendingaio` after langbranch main tag, you can setup one specific paragraph in several languages, and if you decide that some locale user to share the same language, you can just type the locale code you want to refer to directly in content. For example, you can make UK version the same as US version.

However, if LangBranch go too deep (chain over 5 stacks) it will fail.
Don’t do this:
–1—||—2—||—3—||—4—||—5—||—6—> Oh no!
en_US -> en_GB -> en_AU -> en_HK -> zh_TW -> ja_JP

Seperate Mode

“`php
[langbranch en_US]
Content here will only be displayed if get_locale() returns “en_US”.
[/langbranch][langbranch en_US zh_TW]
Content here will only be displayed if get_locale() returns “en_US” or “zh_TW”.
這裡的內容,只有當 get_locale() 回傳 “en_US” 或 “zh_TW” 才會顯示。
[/langbranch]
Very straight forward, isn't?
But when using several shortcodes, I would suggest you don't put a linebreak between
[/langbranch]and[langbranch], in order to prevent unwanted linebreak
` being rendered.

Optional step

All contents enclosed by [langbranch] will be rendered enclosed by


So if you are using auto machine translating like TranslatePress offers, you may want to exclude all selector .langbranch.

Recaps

What this “plugin” do is very simple, it doesn’t has access to either filesystem or database.

However, you still have chance to encounter some issues while using it.
For the worst case, it breaks your site up if script produce error.
If that happen, do not be panic!
Just go to your wp-content/plugins directory and delete langbranch and you shall be fine.

Links

Visit Github repo for issues tracking and reporting.
Visit hollen9.com for latest updates and thoughts.
Buy me a coffee for supporting my works.

Installation

No installation instructions available

Frequently Asked Questions

No FAQ available

Review feed

No reviews available

Screenshots

No screenshots available

Changelog

1.01

  • Check array’s key before accessing it in order to avoid PHP notice message.

1.0

  • Init push