/conditional_message/src/Entity/ConditionalMessage.php

  public function getPathOptions() {
    $path_options = [];
    $path_values = $this->get('path_options')->getValue();
    foreach ($path_values as $raw_value) { //drupal_set_message('1) '.$raw_value['value']);
/*WT+ language prefixes */
      //array_push($path_options, $raw_value['value']);
		if( $languages_prefixes = \Drupal::config('language.negotiation')->get('url.prefixes') ) {
			foreach($languages_prefixes as $id => $pref) {
				$pref = ($pref) ? '/' . $pref : '/' ;
				$value_lp = ($raw_value['value'] != '/') ? $pref . $raw_value['value'] : $pref ;
				$value_lp = str_replace('//', '/', $value_lp); //drupal_set_message('2) '. $value_lp);
				array_push($path_options, $value_lp);
			}
		}
    }
    return $path_options;
  }

Comments

Promo-IL created an issue. See original summary.

promo-il’s picture

Issue summary: View changes
savel’s picture

Hello, Promo-IL, thank you for your contribution!

Could you give some details for your code? What is the problem you're going to solve?

If the code you've posted is a patch, could you save the code as a diff? Then we'll be able to review, apply and test.

Thank you

wranvaud’s picture

Version: 8.x-1.0-beta2 » 8.x-1.0-beta4
Status: Active » Fixed
Issue tags: +multilingual

Thank you for your code @Promo-IL , this is indeed in the right direction. Incorporated into the codebase and will be available in the next release beta5.

  • wranvaud committed 5889c34 on 8.x-1.x
    Issue #3143679 by Promo-IL, wranvaud: language prefixes + failsafe if...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.