Skip to content

Commit

Permalink
Add language support to compatibility status table (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
EXtremeExploit authored May 8, 2024
1 parent ee3678b commit deb60c1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
5 changes: 5 additions & 0 deletions _includes/languagescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,9 @@ $scope.changeLang = function (field) {
$scope.lang = "ja"
}
lang = $scope.lang
if ('URLSearchParams' in window) {
var searchParams = new URLSearchParams(window.location.search);
searchParams.set('lang', lang);
window.location.search = searchParams.toString();
}
}
16 changes: 13 additions & 3 deletions compatibility.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
return decodeURIComponent(name[1]);
}
angular.module('Vita3K', []).controller("angularController", async function ($scope, $filter, $http) {
{% include languagescript.js %}
$scope.views = []
$scope.views['Unknown'] = []
$scope.views['Crashes'] = []
Expand All @@ -22,7 +23,6 @@
$scope.views['Ingame -'] = []
$scope.views['Ingame +'] = []

{% include languagescript.js %}

$scope.changeView = function (field) {
$scope.data = $scope.views[field];
Expand Down Expand Up @@ -120,8 +120,18 @@

res.list.forEach((e) => {
// Unknown already has all games, no need to add it twice
if(e.status != 'Unknown')
if (e.status != 'Unknown') {
switch (e.status) {
case 'Nothing': e.translatedStatus = $scope.texts[5]; break;
case 'Bootable': e.translatedStatus = $scope.texts[6]; break;
case 'Intro': e.translatedStatus = $scope.texts[7]; break;
case 'Menu': e.translatedStatus = $scope.texts[8]; break;
case 'Ingame -': e.translatedStatus = $scope.texts[9]; break;
case 'Ingame +': e.translatedStatus = $scope.texts[10]; break;
case 'Playable': e.translatedStatus = $scope.texts[4]; break;
}
$scope.views[e.status].push(e);
}
});
});

Expand Down Expand Up @@ -248,7 +258,7 @@ <h2 class="section-heading">{{texts[26]}}</h2>
<tr ng-repeat="entry in data | filter: filterEntries(field) track by $index">
<td align="left"><b><small>{{entry.titleId}}</small></b></td>
<td align="left"><a href="https://github.com/Vita3K/compatibility/issues/{{entry.issueId}}"><small>{{entry.name}}</small></a></td>
<td bgcolor="{{entry.color}}"><font color="white"><small>{{entry.status}}</small></font></td>
<td bgcolor="{{entry.color}}"><font color="white"><small>{{entry.translatedStatus}}</small></font></td>
</tr>
</tbody>
</table>
Expand Down

0 comments on commit deb60c1

Please sign in to comment.