Custom language negotiation module not working I'm writing a custom module to allow the use of language a language suffix (of the form -eng or -fra) rather than the standard prefix.

I'm using the language's configured prefix and have a number of functions in place.

I've implemented hook_language_negotiation_info, and have a language selector, switcher and rewriter in place.

Paths with the suffix are working except that urls aren't being updated with the suffix when they're printed in the menus, or other places.

I confirmed that the rewriter callback is being called by placing a dsm() call in the function and it seems to be taking "node/45" and returning "page/45-eng" based on the alias.  That aliased path works, but a url to "node/45" prints returns "page/45"

function custom_lang_language_negotiation_info() {
 return array(
    'custom_language_provider' =&gt; array(
      'callbacks' =&gt; array(
        'language' =&gt; 'custom_lang_language_getter',
        'switcher' =&gt; 'custom_lang_language_switcher_url',
        'url_rewrite' =&gt; 'custom_lang_url_rewriter',
      ),
      'file' =&gt; drupal_get_path('module', 'custom_lang') . '/custom_lang.inc',
      'weight' =&gt; -10,
      'types' =&gt; array(LANGUAGE_TYPE_CONTENT, LANGUAGE_TYPE_INTERFACE, LANGUAGE_TYPE_URL),
      'name' =&gt; t('Custom path suffix'),
      'description' =&gt; t('Determine the language from the URL suffix.'),
      'cache' =&gt; 0,
    ),
  );
}


Thoughts or something I can try?

I may be missing something in the way urls are generated or maybe the path is being reverted somewhere.
I did the configuration with yml file.. try this solution 

https://www.drupal.org/node/2775809#comment-11502283 

It worked for me.