1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-06-05 22:09:38 +02:00

Completo utilizzo delle funzionalità di Symfony Translator

Miglioramento nella gestione delle sostituzioni inline per le traduzioni, con aggiunta di alcune opzioni integrate per modificare l'output (tutto maiuscolo o tutto minuscolo).
Aggiunta della libreria danielstjules/stringy per migliorare la gestione delle stringhe con supporto completo alla codifica UTF-8.
This commit is contained in:
Thomas Zilio
2017-09-10 14:35:41 +02:00
parent 57b88358d0
commit 9c5625c3bb
87 changed files with 1665 additions and 1204 deletions

View File

@@ -1,5 +1,7 @@
<?php
use Stringy\Stringy as S;
if (!function_exists('parse_ini_string')) {
/**
* Simulazione di "parse_ini_string".
@@ -52,7 +54,8 @@ if (!function_exists('starts_with')) {
*/
function starts_with($string, $starts_with)
{
return strpos($string, $starts_with) === 0;
//return strpos($string, $starts_with) === 0;
return S::create($string)->startsWith($starts_with);
}
}
@@ -67,7 +70,8 @@ if (!function_exists('ends_with')) {
*/
function ends_with($string, $ends_with)
{
return substr($string, -strlen($ends_with)) === $ends_with;
//return substr($string, -strlen($ends_with)) === $ends_with;
return S::create($string)->endsWith($ends_with);
}
}
@@ -82,7 +86,8 @@ if (!function_exists('str_contains')) {
*/
function str_contains($string, $contains)
{
return strpos($string, $contains) !== false;
//return strpos($string, $contains) !== false;
return S::create($string)->contains($contains);
}
}