Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Some translations have been lost in the new version (10.0) #1762

Merged
merged 23 commits into from Jun 2, 2021
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 13 additions & 8 deletions app/main/Support/Finder.php
Expand Up @@ -16,38 +16,43 @@ class Finder
protected array $files = [];

public function __construct(
protected SymfonyFinder $instance
protected SymfonyFinder $finder
) {
}

public function get(string|array $path): array
{
$this->search($path);

return $this->files();
return $this->files($path);
}

protected function search(string|array $path): void
{
foreach ($this->find($path) as $file) {
$this->push($file->getRealPath());
$this->push($path, $file->getRealPath());
}
}

protected function find(string|array $path): SymfonyFinder
{
return $this->instance->in($path)->files()
return $this->finder()->in($path)->files()
->name($this->names)
->contains($this->contains);
}

protected function push(string $path): void
protected function push(string|array $source, string $path): void
{
$this->files[] = $path;
$this->files[$source][] = $path;
}

protected function files(): array
protected function files(string|array $path): array
{
return $this->files;
return $this->files[$path] ?? [];
}

protected function finder(): SymfonyFinder
{
return clone $this->finder;
}
}
4 changes: 2 additions & 2 deletions app/main/Support/Package.php
Expand Up @@ -9,7 +9,7 @@ class Package
{
protected ?string $path;

protected array $filter = ['$this', 'self::', 'auth.', 'pagination.', 'passwords.', 'validation.'];
protected array $filter = ['$', 'self::', 'static::', 'auth.', 'pagination.', 'passwords.', 'validation.'];

public function __construct(
protected Finder $finder,
Expand Down Expand Up @@ -52,6 +52,6 @@ protected function parsed(array $files): array

protected function filter(array $items): array
{
return array_filter(array_keys($items), fn ($value) => ! Str::startsWith($value, $this->filter));
return array_filter(array_keys($items), fn ($value) => ! Str::contains($value, $this->filter));
}
}
20 changes: 16 additions & 4 deletions app/main/Support/Parser.php
Expand Up @@ -10,7 +10,7 @@ class Parser
{
use Makeable;

protected const REGEX = '/\b(__|trans|@lang|Lang\:\:get)\((.+)(\)|,\s?\[)/U';
protected const REGEX = '/\b(__|trans|lang|Lang\:\:get)\(\r*\s*(.+)\r*\s*(\)|,\s?\[)/U';

protected array $files = [];

Expand All @@ -25,12 +25,18 @@ public function files(array $files): self

public function get(): array
{
$this->clear();
$this->each();
$this->sort();

return $this->keys();
}

protected function clear(): void
{
$this->keys = [];
}

protected function each(): void
{
foreach ($this->files as $file) {
Expand All @@ -53,7 +59,9 @@ protected function parse(string $content): void
if (Str::contains((string) $value, ['__', 'trans', '@lang', 'Lang::get'])) {
$sub_key = $this->subkey($value);

$value = $this->keys[$sub_key] ?? null;
$sub_value = $this->keys[$sub_key] ?? null;

$this->push($sub_value);
}

$this->push($value);
Expand Down Expand Up @@ -90,8 +98,12 @@ protected function keys(): array

protected function trim($value)
{
$chars = " \t\n\r\0\x0B'\"";
if (is_string($value)) {
$chars = " \t\n\r\0\x0B'\"";

return trim(stripslashes($value), $chars);
}

return is_string($value) ? trim($value, $chars) : $value;
return $value;
}
}
34 changes: 17 additions & 17 deletions locales/af/af.json
@@ -1,48 +1,48 @@
{
"A fresh verification link has been sent to your email address.": "'n Nuwe verifikasie-skakel is na u e-posadres gestuur.",
"All rights reserved.": "Alle regte voorbehou.",
"Before proceeding, please check your email for a verification link.": "Kontroleer u e-pos vir 'n verifikasie-skakel voordat u verder gaan.",
"click here to request another": "kliek hier om nog een aan te vra",
"Confirm Password": "Bevestig Wagwoord",
"Dashboard": "Paneelbord",
"E-Mail Address": "E-pos adres",
"Forbidden": "Prohibido",
"Go to page :page": "Gaan na bladsy :page",
"Forgot Your Password?": "Het jy jou wagwoord vergeet?",
"Go Home": "Gaan huis toe",
"Hello!": "Hallo!",
"If necessary, you may logout of all of your other browser sessions across all of your devices. Some of your recent sessions are listed below; however, this list may not be exhaustive. If you feel your account has been compromised, you should also update your password.": "As dit nodig is, kan u al u blaaier-sessies op al u toestelle afmeld. Sommige van u onlangse sessies word hieronder gelys; hierdie lys mag egter nie volledig wees nie. As u voel dat u rekening gekompromitteer is, moet u ook u wagwoord opdateer.",
"If you did not create an account, no further action is required.": "As u nie 'n rekening geskep het nie, is geen verdere optrede nodig nie.",
"If you did not receive the email": "As u nie die e-pos ontvang het nie",
"If you did not request a password reset, no further action is required.": "As u nie 'n wagwoordregstelling gevra het nie, is geen verdere optrede nodig nie.",
"If you’re having trouble clicking the \":actionText\" button, copy and paste the URL below\ninto your web browser:": "As u sukkel om op die knoppie \":actionText\" te klik, kopieer en plak die URL hieronder in u webblaaier:",
"Invalid signature.": "Ongeldige handtekening.",
"Log out": "Teken uit",
"Logout Other Browser Sessions": "Meld af van ander blaaier sessies",
"Manage and logout your active sessions on other browsers and devices.": "Bestuur en meld u aktiewe sessies op ander blaaiers en toestelle af.",
"Nevermind": "Toemaar",
"Login": "Teken aan",
"Logout": "Teken uit",
"Name": "Naam",
"Not Found": "Nie gevind nie",
"Oh no": "Ag nee",
"Page Expired": "Bladsy het verval",
"Pagination Navigation": "Paginasie-navigasie",
"Password": "Wagwoord",
"Please click the button below to verify your email address.": "Klik op die onderstaande knoppie om u e-posadres te verifieer.",
"Please confirm your password before continuing.": "Bevestig u wagwoord voordat u verder gaan.",
"Please enter your password to confirm you would like to logout of your other browser sessions across all of your devices.": "Voer u wagwoord in om te bevestig dat u u ander blaaier-sessies op al u toestelle wil afmeld.",
"Please provide the email address of the person you would like to add to this team. The email address must be associated with an existing account.": "Verskaf asseblief die e-pos adres van die persoon wat jy wil graag by te voeg aan hierdie span. Die e-pos adres moet wees wat verband hou met'n bestaande rekening.",
"Regards": "Groete",
"results": "resultate",
"Register": "Registreer",
"Remember Me": "Onthou my",
"Reset Password": "Herstel wagwoord",
"Reset Password Notification": "Herstel wagwoord",
"Send Password Reset Link": "Stuur skakel vir wagwoordherstel",
"Server Error": "Bedienerprobleem",
"Service Unavailable": "Diens Onbeskikbaar",
"Showing": "Wys",
"The :attribute must contain at least one letter.": "The :attribute must contain at least one letter.",
"The :attribute must contain at least one number.": "The :attribute must contain at least one number.",
"The :attribute must contain at least one symbol.": "The :attribute must contain at least one symbol.",
"The :attribute must contain at least one uppercase and one lowercase letter.": "The :attribute must contain at least one uppercase and one lowercase letter.",
"The given :attribute has appeared in a data leak. Please choose a different :attribute.": "The given :attribute has appeared in a data leak. Please choose a different :attribute.",
"This action is unauthorized.": "Hierdie aksie is ongemagtig.",
"This password reset link will expire in :count minutes.": "Hierdie skakel vir die herstel van u wagwoord sal verval oor :count minute.",
"to": "tot",
"Toggle navigation": "Skakel navigasie",
"Too Many Attempts.": "Te veel pogings.",
"Too Many Requests": "Te veel versoeke",
"Unauthorized": "Ongemagtigde",
"Verify Email Address": "Bevestig e-posadres",
"Verify Your Email Address": "Bevestig jou e-pos adres",
"We won't ask for your password again for a few hours.": "Ons sal u wagwoord vir 'n paar uur nie weer vra nie.",
"Whoops!": "Oeps!!",
"You are logged in!": "U is aangemeld!",
"You are receiving this email because we received a password reset request for your account.": "U ontvang hierdie e-pos omdat ons 'n versoek vir die herstel van wagwoord vir u rekening ontvang het.",
"Your email address is not verified.": "U e-posadres is nie geverifieer nie."
}
11 changes: 0 additions & 11 deletions locales/af/packages/jetstream.json
Expand Up @@ -110,17 +110,6 @@
"Terms of Service": "Diensvoorwaardes",
"Thanks for signing up! Before getting started, could you verify your email address by clicking on the link we just emailed to you? If you didn't receive the email, we will gladly send you another.": "Dankie vir die aanmelding! Kan u, voordat u begin het, u e-posadres verifieer deur op die skakel te klik wat ons so pas aan u gestuur het? As u nie die e-pos ontvang het nie, stuur ons u graag nog een.",
"The :attribute must be a valid role.": "Die :attribute moet 'n geldige rol wees.",
"The :attribute must be at least :length characters and contain at least one number.": "Die :attribute moet ten :length lengte karakters bevat en ten minste een nommer bevat.",
"The :attribute must be at least :length characters and contain at least one special character and one number.": "Die :attribute moet ten minste :length karakters en bevat ten minste een spesiale karakter en een nommer.",
"The :attribute must be at least :length characters and contain at least one special character.": "Die :attribute moet ten :length lengte karakters bevat en ten minste een spesiale karakter bevat.",
"The :attribute must be at least :length characters and contain at least one uppercase character and one number.": "Die :attribute moet ten minste :length karakters bevat en ten minste een hoofletter en een nommer bevat.",
"The :attribute must be at least :length characters and contain at least one uppercase character and one special character.": "Die :attribute moet ten minste :length karakters bevat en ten minste een hoofletter en een spesiale karakter bevat.",
"The :attribute must be at least :length characters and contain at least one uppercase character, one number, and one special character.": "Die :attribute moet ten minste :length karakters bevat en ten minste een hoofletter, een nommer en een spesiale karakter bevat.",
"The :attribute must be at least :length characters and contain at least one uppercase character.": "Die :attribute moet ten minste :length karakters bevat en ten minste een hoofletter bevat.",
"The :attribute must be at least :length characters.": "Die :attribute moet ten minste :length karakters bevat.",
"The provided password does not match your current password.": "Die wagwoord wat verskaf word, stem nie ooreen met u huidige wagwoord nie.",
"The provided password was incorrect.": "Die verskafde wagwoord was verkeerd.",
"The provided two factor authentication code was invalid.": "Die verstrekte tweefaktor-verifikasiekode was ongeldig.",
"The team's name and owner information.": "Die span se naam en eienaarinligting.",
"These people have been invited to your team and have been sent an invitation email. They may join the team by accepting the email invitation.": "Hierdie mense is na u span genooi en 'n uitnodiging-e-pos gestuur. Hulle kan by die span aansluit deur die e-posuitnodiging te aanvaar",
"This device": "Hierdie toestel",
Expand Down
34 changes: 17 additions & 17 deletions locales/ar/ar.json
@@ -1,48 +1,48 @@
{
"A fresh verification link has been sent to your email address.": "تم إرسال رابط تحقق جديد إلى عنوان بريدك الإلكتروني.",
"All rights reserved.": "جميع الحقوق محفوظة.",
"Before proceeding, please check your email for a verification link.": "قبل المتابعة، يرجى التحقق من بريدك الإلكتروني عن رابط التحقق.",
"click here to request another": "انقر هنا لطلب آخر",
"Confirm Password": "تأكيد كلمة المرور",
"Dashboard": "لوحة التحكم",
"E-Mail Address": "البريد الإلكتروني",
"Forbidden": "محظور",
"Go to page :page": "الإنتقال إلى الصفحة :page",
"Forgot Your Password?": "نسيت كلمة المرور؟",
"Go Home": "الرئيسية",
"Hello!": "أهلاً بك!",
"If necessary, you may logout of all of your other browser sessions across all of your devices. Some of your recent sessions are listed below; however, this list may not be exhaustive. If you feel your account has been compromised, you should also update your password.": "إذا لزم الأمر، يمكنك تسجيل الخروج من جميع جلسات المتصفحات الأخرى عبر جميع أجهزتك. بعض جلساتك الأخيرة مذكورة أدناه؛ ومع ذلك، قد لا تكون هذه القائمة شاملة. إذا شعرت أنه تم اختراق حسابك، فيجب عليك أيضًا تحديث كلمة المرور الخاصة بك.",
"If you did not create an account, no further action is required.": "إذا لم تقم بإنشاء حساب ، فلا يلزم اتخاذ أي إجراء آخر.",
"If you did not receive the email": "إذا لم تستلم البريد الإلكتروني",
"If you did not request a password reset, no further action is required.": "إذا لم تقم بطلب استعادة كلمة المرور، لا تحتاج القيام بأي إجراء.",
"If you’re having trouble clicking the \":actionText\" button, copy and paste the URL below\ninto your web browser:": "إذا كنت تواجه مشكلة في النقر على الزر \":actionText \"، يمكنك نسخ عنوان URL أدناه\n وألصقه في متصفح الويب:",
"Invalid signature.": "التوقيع غير سليم.",
"Log out": "تسجيل الخروج",
"Logout Other Browser Sessions": "تسجيل الخروج من حسابي على المتصفحات الأخرى",
"Manage and logout your active sessions on other browsers and devices.": "إدارة جلساتك النشطة وتسجيل الخروج منها على المتصفحات والأجهزة الأخرى.",
"Nevermind": "إلغاء",
"Login": "تسجيل الدخول",
"Logout": "تسجيل الخروج",
"Name": "الاسم",
"Not Found": "غير متوفر",
"Oh no": "انتبه",
"Page Expired": "الصفحة منتهية الصلاحية",
"Pagination Navigation": "التنقل بين الصفحات",
"Password": "كلمة المرور",
"Please click the button below to verify your email address.": "يرجى النقر على الزر أدناه للتحقق من عنوان بريدك الإلكتروني.",
"Please confirm your password before continuing.": "يرجى تأكيد كلمة مرورك قبل المتابعة.",
"Please enter your password to confirm you would like to logout of your other browser sessions across all of your devices.": "الرجاء إدخال كلمة المرور الخاصة بك لتأكيد رغبتك في تسجيل الخروج من جلسات المتصفح الأخرى عبر جميع أجهزتك.",
"Please provide the email address of the person you would like to add to this team. The email address must be associated with an existing account.": "يرجى كتابة عنوان البريد الإلكتروني للشخص الذي ترغب في إضافته إلى هذا الفريق. يجب أن يكون عنوان البريد الإلكتروني مرتبطًا بحساب موجود.",
"Regards": "مع التحية",
"results": "نتيجة",
"Register": "تسجيل",
"Remember Me": "تذكرني",
"Reset Password": "استعادة كلمة المرور",
"Reset Password Notification": "تنبيه استعادة كلمة المرور",
"Send Password Reset Link": "أرسل رابط استعادة كلمة المرور",
"Server Error": "خطأ في الإستضافة",
"Service Unavailable": "الخدمة غير متوفرة",
"Showing": "عرض",
"The :attribute must contain at least one letter.": ":attribute يجب أن يحتوي على الأقل حرف واحد.",
"The :attribute must contain at least one number.": ":attribute يجب أن يحتوي على الأقل رقم واحد.",
"The :attribute must contain at least one symbol.": ":attribute يجب أن يحتوي على الأقل رمز واحد.",
"The :attribute must contain at least one uppercase and one lowercase letter.": ":attribute يجب أن يحتوي على الأقل حرف كبير واحد وحرف صغير واحد.",
"The given :attribute has appeared in a data leak. Please choose a different :attribute.": ":attribute المستخدم ضمن قائمة البيانات المسربة. الرجاء اختيار :attribute مختلف.",
"This action is unauthorized.": "عملية غير مصرّح بها.",
"This password reset link will expire in :count minutes.": "ستنتهي صلاحية رابط استعادة كلمة المرور خلال :count دقيقة.",
"to": "إلى",
"Toggle navigation": "إظهار\/إخفاء القائمة",
"Too Many Attempts.": "عدد كبير من المحاولات.",
"Too Many Requests": "طلبات كثيرة جدًا",
"Unauthorized": "غير مصرّح",
"Verify Email Address": "التحقق من عنوان البريد الإلكتروني",
"Verify Your Email Address": "تحقق من عنوان البريد الإلكتروني الخاص بك",
"We won't ask for your password again for a few hours.": "لن نطلب كلمة المرور مرة أخرى لبضع ساعات.",
"Whoops!": "عذراً!",
"You are logged in!": "لقد قمت بتسجيل الدخول!",
"You are receiving this email because we received a password reset request for your account.": "لقد استلمت هذا الإيميل لأننا استقبلنا طلباً لاستعادة كلمة مرور حسابك.",
"Your email address is not verified.": "بريدك الإلكتروني غير موثّق."
}