translate kiosk name using resources
fix CDATA fuu
This commit is contained in:
parent
29fee28d1d
commit
46fa9a9366
10 changed files with 82 additions and 8 deletions
|
|
@ -0,0 +1,38 @@
|
|||
package org.schabi.newpipe.util;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import org.schabi.newpipe.R;
|
||||
|
||||
/**
|
||||
* Created by Chrsitian Schabesberger on 28.09.17.
|
||||
* KioskTranslator.java is part of NewPipe.
|
||||
*
|
||||
* NewPipe is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* NewPipe 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with NewPipe. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
public class KioskTranslator {
|
||||
public static String getTranslatedKioskName(String kioskId, Context c) {
|
||||
switch(kioskId) {
|
||||
case "Trending":
|
||||
return c.getString(R.string.trending);
|
||||
case "Top 50":
|
||||
return c.getString(R.string.top_50);
|
||||
case "New & hot":
|
||||
return c.getString(R.string.new_and_hot);
|
||||
default:
|
||||
return kioskId;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue