WordPress doesn’t quite have a practice of localizing something that isn’t core/plugin/theme.
My educated guess would be that it will work just fine with same concepts, but you will have to write custom loading logic. Use lower level load_textdomain()
, since higher level functions are meant for plugins/themes specifically.
As long as you determine and load domain translation correctly, WordPress wouldn’t care that calls are coming from the library context.
Related Posts:
- How to find which .mo file is responsible for displaying a particular localized string?
- How does printf( __( ) ); work?
- Why include a composer.json file with my plugin?
- Autoloading in Child Theme
- Namespacing WordPress project according to FIG standards
- Who’s job is it to load a plugin’s translated strings?
- Use composer to load custom classes [closed]
- How do I translate this string – PHP syntax question
- Proper use of internationalization
- How to register javascript variables in wp_localize_script?
- How to Internationalize WordPress – Extract strings with textdomains, per textdomain individually
- Decimal values via get_option() with custom local (decimal point = comma)
- Plugin development and composer
- How can I search all plugins for composer’s vendor/autoload.php?
- Composer setup-config.php not found
- Prevent Company Name From Translating
- PHP Warning missing Argument 1 for __()
- Import js variables loaded via wp_localize_script() into js module without global scope connection
- How to add a php package to an existing wordpress website
- Pass media upload value to input field
- What does the token %1$s in WordPress represent [closed]
- Experiences with compiling WordPress using Hip Hop?
- WordPress redirect to landing page if not logged in
- PHP/Manual use of images? – 2 Questions
- Debugging upload problem: What part of WP does actual image-resizing?
- Remove class that has been added by parent theme
- How to use a frontend URL with a Plugin
- Get list of shortcodes from content
- Adding Google Analytics code to the tag of specific pages
- Site Health : An active PHP session was detected
- login wp impossible
- Custom image upload
- How to scale image with equal width and height without distortion?
- Create Logout Link WordPress Admin Menu
- PHP 5.5, w3 Total Cache, and opcache [closed]
- PHP in post content [closed]
- Display post image with fancybox
- Attaching a pdf to Contact Form 7 e-mail via functions.php [closed]
- WordPress – how to replace with string on the_content() in single.php
- Getting array of customizer settings
- Add a variable in functions.php and call it in single.php
- Linking text within textarea of custom meta box
- Ajax random number always the same
- Grab posts by multiple categories
- How to change the oembed “type”?
- Modify user profile data through scripting?
- wordpress + woocommerce display product with additional information [closed]
- get_children displaying images removed from the page
- running arbitrary php files
- Loading php file with AJAX in WordPress frontend
- Localize plugin name
- Inline style to PHP [closed]
- Asynchronous multiple requests 401 Unauthorized
- Get the URL of the page from which an ajax request has been launched within ajax callback
- Edit the_category (); for a hierarchical display
- WordPress archive page showing 404 Error [duplicate]
- Division by zero error in image.php
- How to have different header.php based on the user logged in?
- How do I include SVG file used as featured image?
- Return product description
- How to add the sidebar to all the pages except the home page? [closed]
- is_page_template showing partial results
- WordPress loop by meta key that is an array? and how loop multiple arrays
- Adding regular php file to site
- REST API works in browser and via AJAX but fails via cURL
- How to display different submenus?
- Remove slugs from custom posts type
- Simple jQuery AJAX Request fails to run PHP Script
- Update if post with specific title exists
- Pass important values server-side when processing form
- Wp_editor doesn’t send the required data
- pass html code to worpdress
- Can ‘Custom Field’ data be inserted into this Short Code?
- Merge 2 product attribute terms
- Run do_shortcode on php template using JS function
- global $product is empty string when passed into function
- How to update custom fields when post is published?
- Gravity Forms: How to add PHP function to confirmation conditional shortcode?
- wpdb->query returns different value to phpMyAdmin
- Trouble Accessing Gravity Forms API (GFAPI)
- Add a default style if no Featured image is selected
- When to use wp_register_script() function?
- setcookie() issues on running with HTTPS on WordPress
- loading a php file to a specific page id
- How to load WP_Editor JS files manually (with AJAX)?
- How can I enqueue comment-reply script only on certain page?
- Querying posts from wordpress with 2 or more conditionals
- Importing demo data in Multisite
- Posts with Custom Fields does not appear
- How to export database correctly for local to online
- Replace TinyMCE with Custom Built Editor
- Setting field not saving on front-end
- Getting custom field data from cart page to checkout page in woocomerce [closed]
- php grabbing every post made?
- SQL – How to echo out inside of where statement
- How to create different templates for woocommerce single-product.php?
- How can I update a value of a field depending on outside source?
- Restricting access to a file for everyone except logged in users
- WordPress Block Editor Gutenberg running code inside ! is_admin()
- Tags being Inserted in html from plugin PHP not passing through the_content