Skip to content

Commit

Permalink
adapt language distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
bozana committed Nov 29, 2024
1 parent 19a5c3b commit 56a3861
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion classes/i18n/LocaleMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public function isComplete(float $minimumThreshold = 0.9, ?string $referenceLoca
/**
* Retrieves the ISO639-1 representation
*/
public function getIsoAlpha2(): string
public function getIsoAlpha2(): ?string
{
return $this->_getLanguage()->getAlpha2();
}
Expand Down
2 changes: 1 addition & 1 deletion classes/template/PKPTemplateManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ public function initialize(PKPRequest $request)
$path = $router->getRequestedArgs($request);
$url = fn (string $locale = ''): string => $router->url($request, null, $page, $op, $path, urlLocaleForPage: $locale);
collect($supportedLocales)
->each(fn (string $l) => $this->addHeader("language-{$l}", "<link rel='alternate' hreflang='" . str_replace(['_'], ['-'], $l) . "' href='" . $url($l) . "' />"));
->each(fn (string $l) => $this->addHeader("language-{$l}", "<link rel='alternate' hreflang='" . str_replace(['_', '@'], '-', $l) . "' href='" . $url($l) . "' />"));
$this->addHeader('language-xdefault', "<link rel='alternate' hreflang='x-default' href='" . $url() . "' />");
})();
}
Expand Down

0 comments on commit 56a3861

Please sign in to comment.