Skip to content

Commit 6c238fa

Browse files
committed
fixup! Convert newpipe/util/KioskTranslator.java to kotlin
Copyright and license header are not doc-comments. Move them to the top of the file. Also re-write it to follow the SPDX formatting as we have followed in the recent Kotlin conversion. Additionally, use a better name for the context parameter. Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
1 parent e17b1a1 commit 6c238fa

1 file changed

Lines changed: 22 additions & 39 deletions

File tree

app/src/main/java/org/schabi/newpipe/util/KioskTranslator.kt

Lines changed: 22 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,33 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2017-2025 NewPipe contributors <https://newpipe.net>
3+
* SPDX-FileCopyrightText: 2025 NewPipe e.V. <https://newpipe-ev.de>
4+
* SPDX-License-Identifier: GPL-3.0-or-later
5+
*/
6+
17
package org.schabi.newpipe.util
28

39
import android.content.Context
410
import org.schabi.newpipe.R
511

6-
/**
7-
* Created by Christian Schabesberger on 28.09.17.
8-
* KioskTranslator.java is part of NewPipe.
9-
*
10-
*
11-
* NewPipe is free software: you can redistribute it and/or modify
12-
* it under the terms of the GNU General Public License as published by
13-
* the Free Software Foundation, either version 3 of the License, or
14-
* (at your option) any later version.
15-
*
16-
*
17-
*
18-
* NewPipe is distributed in the hope that it will be useful,
19-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
20-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21-
* GNU General Public License for more details.
22-
*
23-
*
24-
*
25-
* You should have received a copy of the GNU General Public License
26-
* along with NewPipe. If not, see <http:></http:>//www.gnu.org/licenses/>.
27-
*
28-
*/
2912
object KioskTranslator {
3013
@JvmStatic
31-
fun getTranslatedKioskName(kioskId: String, c: Context): String {
14+
fun getTranslatedKioskName(kioskId: String, context: Context): String {
3215
return when (kioskId) {
33-
"Trending" -> c.getString(R.string.trending)
34-
"Top 50" -> c.getString(R.string.top_50)
35-
"New & hot" -> c.getString(R.string.new_and_hot)
36-
"Local" -> c.getString(R.string.local)
37-
"Recently added" -> c.getString(R.string.recently_added)
38-
"Most liked" -> c.getString(R.string.most_liked)
39-
"conferences" -> c.getString(R.string.conferences)
40-
"recent" -> c.getString(R.string.recent)
41-
"live" -> c.getString(R.string.duration_live)
42-
"Featured" -> c.getString(R.string.featured)
43-
"Radio" -> c.getString(R.string.radio)
44-
"trending_gaming" -> c.getString(R.string.trending_gaming)
45-
"trending_music" -> c.getString(R.string.trending_music)
46-
"trending_movies_and_shows" -> c.getString(R.string.trending_movies)
47-
"trending_podcasts_episodes" -> c.getString(R.string.trending_podcasts)
16+
"Trending" -> context.getString(R.string.trending)
17+
"Top 50" -> context.getString(R.string.top_50)
18+
"New & hot" -> context.getString(R.string.new_and_hot)
19+
"Local" -> context.getString(R.string.local)
20+
"Recently added" -> context.getString(R.string.recently_added)
21+
"Most liked" -> context.getString(R.string.most_liked)
22+
"conferences" -> context.getString(R.string.conferences)
23+
"recent" -> context.getString(R.string.recent)
24+
"live" -> context.getString(R.string.duration_live)
25+
"Featured" -> context.getString(R.string.featured)
26+
"Radio" -> context.getString(R.string.radio)
27+
"trending_gaming" -> context.getString(R.string.trending_gaming)
28+
"trending_music" -> context.getString(R.string.trending_music)
29+
"trending_movies_and_shows" -> context.getString(R.string.trending_movies)
30+
"trending_podcasts_episodes" -> context.getString(R.string.trending_podcasts)
4831
else -> kioskId
4932
}
5033
}

0 commit comments

Comments
 (0)