-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dokan WPML Guides #90
Comments
WPML issue: Text Detected in WPML String List but Not Translating after saving from Menu ManagerIssue Description: If any specific text is not being translated even when detected in the string list using WPML after saving the Menu managerSolution
I hope this helps resolve your issue! 👍🏻
|
WPML JavaScript Translation IssueOverview of the ProblemWPML (WordPress Multilingual Plugin) currently has a limitation in its handling of JavaScript translations. While WPML successfully translates strings in PHP files, it does not automatically generate the necessary JSON files for translating strings in JavaScript files. Detailed Description
ReferenceThis issue is documented in WPML's official errata: https://wpml.org/errata/woocommerce-checkout-block-fails-to-translate-some-values/ Impact
Current WorkaroundUntil WPML addresses this issue, Loco Translate: An Alternative Solution: Unlike WPML, Loco Translate does support the creation of JSON files for JavaScript translations. This makes it a viable alternative for projects that heavily rely on JavaScript and require multilingual support.
Video Reference: Link Long-term SolutionThe permanent solution to this issue requires action from the WPML development team:
|
WPML issue: Dynamic Text Translation Not WorkingIssue Description: If any dynamic text shows on WPML but not translate after language shifting.Solution
I hope this will help you to resolve your issue! 👍🏻 For more, you can check out this issue and the related PR: https://github.com/getdokan/client-issue/issues/182 |
Dokan WPML - Custom/Dynamic String Translation GuideThis guide explains how to register and retrieve custom translatable strings using the Dokan WPML integration. OverviewDokan WPML provides two main methods for handling custom string translations:
Registering Custom StringsMethod Signaturepublic function register_single_string( $context, $name, $value ) Parameters
Example Usage// Register a button text for translation
$this->register_single_string(
'dokan',
'Dokan Request Quote Button Text: ' . $rule_id,
$button_text
);
// Register a shipping status
$this->register_single_string(
'dokan',
'Dokan Shipping Status: ' . $status,
$status
); Retrieving Translated StringsMethod Signaturepublic function get_translated_single_string( $original_value, $domain, $name, $language_code = null ) Parameters
Example Usage// Get translated button text
$translated_text = $this->get_translated_single_string(
$text,
'dokan',
'Dokan Request Quote Button Text: ' . $rule->id
);
// Get translated shipping status
$translated_status = $this->get_translated_single_string(
$status,
'dokan',
'Dokan Shipping Status: ' . $status
); Implementation WorkflowIn Dokan/ Dokan-pro
example : after creation of RFQ rule . do_action( 'dokan_quote_rule_created', $inserted, $args, $wpdb->insert_id );
$rule->button_text = apply_filters( 'dokan_request_quote_button_text', $rule->button_text, $rule ); In Dokna Wpml :Path : dokan-wpml.php
// In your action/hook handler
public function register_quote_button_text($action, $args, $rule_id) {
if (!$action) {
return;
}
$button_text = $args['button_text'];
$this->register_single_string(
'dokan',
'Dokan Request Quote Button Text: ' . $rule_id,
$button_text
);
}
add_action('dokan_quote_rule_created', [$this, 'register_quote_button_text'], 10, 3);
// In your display/render function
public function get_translated_dokan_request_quote_button_text($text, $rule) {
return $this->get_translated_single_string(
$text,
'dokan',
'Dokan Request Quote Button Text: ' . $rule->id
);
}
add_filter('dokan_request_quote_button_text', [$this, 'get_translated_dokan_request_quote_button_text'], 10, 2); Best Practices
Troubleshooting
Related issue link |
WPML issue: Product category translation issue for different languages.Issue Description: Translate vendor dashboard product categories & set category hierarchy for multiple languages.Solution
I hope this helps resolve your issue! 👍🏻 Fixed PR Link |
The text was updated successfully, but these errors were encountered: