Skip to content

Commit

Permalink
Resources: set a cacheCode that is language-specific, fixes AngularJS…
Browse files Browse the repository at this point in the history
… translation with multilingual
  • Loading branch information
mlutfy committed Dec 10, 2021
1 parent c46601a commit 98e2d42
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CRM/Core/Resources.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,9 @@ public function glob($ext, $patterns, $flags = NULL) {
* @return string
*/
public function getCacheCode() {
return $this->cacheCode;
// Ex: AngularJS json partials are language-specific because they ship with the strings
// for the current language.
return $this->cacheCode . CRM_Core_I18n::getLocale();
}

/**
Expand Down Expand Up @@ -563,7 +565,7 @@ public function addCacheCode($url) {
$hasQuery = strpos($url, '?') !== FALSE;
$operator = $hasQuery ? '&' : '?';

return $url . $operator . 'r=' . $this->cacheCode;
return $url . $operator . 'r=' . $this->getCacheCode();
}

/**
Expand Down

0 comments on commit 98e2d42

Please sign in to comment.