Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release-0.10.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Rudloff committed Oct 2, 2017
2 parents 785a2f0 + cd60e07 commit aee67fa
Show file tree
Hide file tree
Showing 23 changed files with 4,462 additions and 1,809 deletions.
22 changes: 18 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
---
language: php
php:
- 5.6
- 7
php: 7
addons:
apt:
packages:
- language-pack-fr
install:
- composer install
before_install:
Expand All @@ -20,4 +23,15 @@ deploy:
env:
global:
- [email protected]
- secure: Icw8UqAilq0+neZsdXn7pny5OrDin1tTN0H3HGPFDBawHWBEffettRsURljnBlm0IcAE8HPvl0DlaGFMedM3ZlYjvp7OqMqe84p7dY22JMvirV4MsMz546FKEYI+g3txawAMDFPCorE+fgkDrL1eUoozGVJxc5c4w4nBVm84QvjxRvCvEKbfevd4giaie1Xuo927lKAwTaVFZryYNotPyJVB2pBBndxfl2EJczJ4DXQc3VczFXkTmuE/QLa2tQVJm5vnVPwOi1xmvgh6g1ChEOw0zAks1Mf5+UvxtVV7qTicVAWK0fVVBL9mHPpNzSNb4pPqHPWQjhAPdCW+WPn6+DhqS5BHeSfQit/OtLMpUWO1IceVDRwU3jkXmMgnKwz1t9yDh6VBZRvGPkXfU3cjQ9SFpmnnu/4JLgwA/zSU2Pzl7/+gsHQBazkXh8HYAbOjF2w1IBXOpZ8Yv7D5axRIDduS/TUQ6oNK3KYmRMBcg8ZzVzIdz+55NchaDtihcp5akaHhKxR7GMPrfi66b+wARSw3OsYmCGLNFF8zj/6zo3/zB02+oVMlXXySOAKKi0A2OvH9xV4W4Jl0TGua/27XOWr9c5btrZrykk3PXfKe5YgT46Q8CtK8yN97bDKbwbAp6gNEyMFFatdHKlEndZYsVDQ16htd0b/303SZfXYMvO0=
- secure:
"Icw8UqAilq0+neZsdXn7pny5OrDin1tTN0H3HGPFDBawHWBEffettRsURljnBlm0Ic\
AE8HPvl0DlaGFMedM3ZlYjvp7OqMqe84p7dY22JMvirV4MsMz546FKEYI+g3txawAMD\
FPCorE+fgkDrL1eUoozGVJxc5c4w4nBVm84QvjxRvCvEKbfevd4giaie1Xuo927lKAw\
TaVFZryYNotPyJVB2pBBndxfl2EJczJ4DXQc3VczFXkTmuE/QLa2tQVJm5vnVPwOi1x\
mvgh6g1ChEOw0zAks1Mf5+UvxtVV7qTicVAWK0fVVBL9mHPpNzSNb4pPqHPWQjhAPdC\
W+WPn6+DhqS5BHeSfQit/OtLMpUWO1IceVDRwU3jkXmMgnKwz1t9yDh6VBZRvGPkXfU\
3cjQ9SFpmnnu/4JLgwA/zSU2Pzl7/+gsHQBazkXh8HYAbOjF2w1IBXOpZ8Yv7D5axRI\
DduS/TUQ6oNK3KYmRMBcg8ZzVzIdz+55NchaDtihcp5akaHhKxR7GMPrfi66b+wARSw\
3OsYmCGLNFF8zj/6zo3/zB02+oVMlXXySOAKKi0A2OvH9xV4W4Jl0TGua/27XOWr9c5\
btrZrykk3PXfKe5YgT46Q8CtK8yN97bDKbwbAp6gNEyMFFatdHKlEndZYsVDQ16htd0\
b/303SZfXYMvO0="
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ Before opening a new issue, make sure that:
* It has not already been [reported](https://github.com/Rudloff/alltube/issues).
* You read the [README](README.md) and the [FAQ](resources/FAQ.md).
* You can provide **logs**.

## Translation

If you want to help translating Alltube in your language, you can join our [POEditor project](https://poeditor.com/join/project/GJmE0wN7Xw).
12 changes: 10 additions & 2 deletions classes/LocaleManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

namespace Alltube;

use Symfony\Component\Process\ProcessBuilder;

/**
* Class used to manage locales.
*/
Expand All @@ -15,7 +17,7 @@ class LocaleManager
*
* @var array
*/
private $supportedLocales = ['en_US', 'fr_FR', 'zh_CN'];
private $supportedLocales = ['en_US', 'fr_FR', 'zh_CN', 'es_ES'];

/**
* Current locale.
Expand Down Expand Up @@ -56,8 +58,14 @@ public function __construct(array $cookies = [])
public function getSupportedLocales()
{
$return = [];
$builder = new ProcessBuilder(['locale', '-a']);
$process = $builder->getProcess();
$process->run();
$installedLocales = explode(PHP_EOL, trim($process->getOutput()));
foreach ($this->supportedLocales as $supportedLocale) {
$return[] = new Locale($supportedLocale);
if (in_array($supportedLocale, $installedLocales)) {
$return[] = new Locale($supportedLocale);
}
}

return $return;
Expand Down
2 changes: 1 addition & 1 deletion classes/ViewFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static function create(ContainerInterface $container, Request $request =
$request = $request->withUri($request->getUri()->withScheme('https')->withPort(443));
}

$smartyPlugins = new SmartyPlugins($container['router'], $request->getUri());
$smartyPlugins = new SmartyPlugins($container['router'], $request->getUri()->withUserInfo(null));
$view->registerPlugin('function', 'path_for', [$smartyPlugins, 'pathFor']);
$view->registerPlugin('function', 'base_url', [$smartyPlugins, 'baseUrl']);

Expand Down
19 changes: 10 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@
"smarty/smarty": "~3.1.29",
"slim/slim": "~3.8.1",
"mathmarques/smarty-view": "~1.1.0",
"symfony/yaml": "~3.2.0",
"symfony/process": "~3.2.0",
"symfony/yaml": "~3.3.9",
"symfony/process": "~3.3.9",
"ptachoire/process-builder-chain": "~1.2.0",
"guzzlehttp/guzzle": "~6.2.0",
"guzzlehttp/guzzle": "~6.3.0",
"aura/session": "~2.1.0",
"barracudanetworks/archivestream-php": "~1.0.5",
"smarty-gettext/smarty-gettext": "~1.5.1",
"zonuexe/http-accept-language": "~0.4.1",
"rinvex/country": "~2.0.0"
},
"require-dev": {
"symfony/var-dumper": "~3.2.0",
"squizlabs/php_codesniffer": "~3.0.0",
"symfony/var-dumper": "~3.3.9",
"squizlabs/php_codesniffer": "~3.1.0",
"phpunit/phpunit": "~5.7.2",
"ffmpeg/ffmpeg": "dev-release",
"rg3/youtube-dl": "~2017.05.09",
"rg3/youtube-dl": "~2017.09.24",
"rudloff/rtmpdump-bin": "~2.3.0",
"heroku/heroku-buildpack-php": "*"
},
Expand All @@ -39,10 +39,10 @@
"type": "package",
"package": {
"name": "rg3/youtube-dl",
"version": "2017.05.09",
"version": "2017.09.24",
"dist": {
"type": "zip",
"url": "https://github.com/rg3/youtube-dl/archive/2017.05.09.zip"
"url": "https://github.com/rg3/youtube-dl/archive/2017.09.24.zip"
}
}
},
Expand Down Expand Up @@ -82,6 +82,7 @@
}
},
"scripts": {
"compile": "composer install --ignore-platform-reqs"
"compile": "composer install --ignore-platform-reqs",
"update-locales": "tsmarty2c.php templates > i18n/template.pot"
}
}
Loading

0 comments on commit aee67fa

Please sign in to comment.