function locale_translation_build_server_pattern in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/locale/locale.translation.inc \locale_translation_build_server_pattern()
Build path to translation source, out of a server path replacement pattern.
Parameters
object $project: Project object containing data to be inserted in the template.
string $template: String containing placeholders. Available placeholders:
- "%project": Project name.
- "%version": Project version.
- "%core": Project core version.
- "%language": Language code.
Return value
string String with replaced placeholders.
1 call to locale_translation_build_server_pattern()
- locale_translation_source_build in core/
modules/ locale/ locale.translation.inc - Builds abstract translation source.
File
- core/
modules/ locale/ locale.translation.inc, line 312 - Common API for interface translation.
Code
function locale_translation_build_server_pattern($project, $template) {
$variables = array(
'%project' => $project->name,
'%version' => $project->version,
'%core' => $project->core,
'%language' => isset($project->langcode) ? $project->langcode : '%language',
);
return strtr($template, $variables);
}