Skip to content

Commit

Permalink
Added translation helper
Browse files Browse the repository at this point in the history
Signed-off-by: Kiran Parajuli <[email protected]>
  • Loading branch information
kiranparajuli589 committed Dec 27, 2022
1 parent 1cc2b64 commit 95d57cd
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions tests/TestHelpers/TranslationHelper.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php declare(strict_types=1);
/**
* ownCloud
*
* @author Talank Baral <[email protected]>
* @copyright Copyright (c) 2021 Talank Baral [email protected]
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License,
* as published by the Free Software Foundation;
* either version 3 of the License, or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/

namespace TestHelpers;

/**
* Class TranslationHelper
*
* Helper functions that are needed to run tests on different languages
*
* @package TestHelpers
*/
class TranslationHelper {
/**
* @param string|null $language
*
* @return string|null
*/
public static function getLanguage(?string $language): ?string {
if (!isset($language)) {
if (\getenv('OC_LANGUAGE') !== false) {
$language = \getenv('OC_LANGUAGE');
}
}
return $language;
}
}

0 comments on commit 95d57cd

Please sign in to comment.