1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 23:22:52 +01:00
invoiceninja/app/Utils/TranslationHelper.php

84 lines
2.2 KiB
PHP
Raw Normal View History

<?php
2019-05-11 05:32:07 +02:00
/**
* Invoice Ninja (https://invoiceninja.com).
2019-05-11 05:32:07 +02:00
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
2024-04-12 06:15:41 +02:00
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
2019-05-11 05:32:07 +02:00
*
2021-06-16 08:58:16 +02:00
* @license https://www.elastic.co/licensing/elastic-license
2019-05-11 05:32:07 +02:00
*/
namespace App\Utils;
2024-01-14 05:05:00 +01:00
use Illuminate\Support\Facades\Cache;
2023-10-26 04:57:44 +02:00
use App\Models\PaymentTerm;
use Illuminate\Support\Str;
class TranslationHelper
{
2024-08-05 03:57:42 +02:00
// public static function getIndustries()
// {
2024-08-22 08:45:06 +02:00
2024-08-05 03:57:42 +02:00
// /** @var \Illuminate\Support\Collection<\App\Models\Currency> */
// $industries = app('industries');
2024-08-05 03:57:42 +02:00
// return $industries->each(function ($industry) {
// $industry->name = ctrans('texts.industry_'.$industry->name);
// })->sortBy(function ($industry) {
// return $industry->name;
// });
// }
public static function getCountries()
{
2024-08-22 08:45:06 +02:00
/** @var \Illuminate\Support\Collection<\App\Models\Country> */
2024-08-05 03:57:42 +02:00
return app('countries');
}
2024-08-05 03:57:42 +02:00
// public static function getPaymentTypes()
// {
2024-08-22 08:45:06 +02:00
2024-08-05 03:57:42 +02:00
// /** @var \Illuminate\Support\Collection<\App\Models\PaymentType> */
// // $payment_types = app('payment_types');
2024-08-05 03:57:42 +02:00
// return \App\Models\PaymentType::all()->each(function ($pType) {
// $pType->name = ctrans('texts.payment_type_'.$pType->name);
// })->sortBy(function ($pType) {
// return $pType->name;
// });
// }
2024-08-05 03:57:42 +02:00
// public static function getLanguages()
// {
2024-08-22 08:45:06 +02:00
2024-08-05 03:57:42 +02:00
// /** @var \Illuminate\Support\Collection<\App\Models\Language> */
// // $languages = app('languages');
2024-08-05 03:57:42 +02:00
// return \App\Models\Language::all()->each(function ($lang) {
// $lang->name = ctrans('texts.lang_'.$lang->name);
// })->sortBy(function ($lang) {
// return $lang->name;
// });
// }
public static function getCurrencies()
{
2024-08-22 08:45:06 +02:00
/** @var \Illuminate\Support\Collection<\App\Models\Currency> */
2024-08-05 03:57:42 +02:00
return app('currencies');
}
2024-08-05 03:57:42 +02:00
// public static function getPaymentTerms()
// {
// return PaymentTerm::getCompanyTerms()->map(function ($term) {
// $term['name'] = ctrans('texts.payment_terms_net').' '.$term['num_days'];
2024-08-05 03:57:42 +02:00
// return $term;
// });
// }
}