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

Finnish keyboard #1995

Merged
merged 2 commits into from
Oct 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package org.mozilla.vrbrowser.ui.keyboards;

import android.content.Context;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import org.mozilla.vrbrowser.R;
import org.mozilla.vrbrowser.input.CustomKeyboard;
import org.mozilla.vrbrowser.ui.widgets.WidgetPlacement;
import org.mozilla.vrbrowser.utils.StringUtils;

import java.util.Locale;

public class FinnishKeyboard extends BaseKeyboard {
private CustomKeyboard mKeyboard;
private CustomKeyboard mSymbolsKeyboard;
private Locale mLocale;

public FinnishKeyboard(Context aContext) {
super(aContext);
mLocale = new Locale("fi", "FI");
}

@NonNull
@Override
public CustomKeyboard getAlphabeticKeyboard() {
if (mKeyboard == null) {
mKeyboard = new CustomKeyboard(mContext.getApplicationContext(), R.xml.keyboard_qwerty_finnish);
}
return mKeyboard;
}

@Nullable
@Override
public CustomKeyboard getSymbolsKeyboard() {
if (mSymbolsKeyboard == null) {
mSymbolsKeyboard = new CustomKeyboard(mContext.getApplicationContext(), R.xml.keyboard_symbols_finnish);
}
return mSymbolsKeyboard;
}

@Override
public float getAlphabeticKeyboardWidth() {
return WidgetPlacement.dpDimension(mContext, R.dimen.keyboard_alphabetic_width_finnish);
}

@Nullable
@Override
public CandidatesResult getCandidates(String aText) {
return null;
}

@Override
public String getKeyboardTitle() {
return StringUtils.getStringByLocale(mContext, R.string.settings_language_finnish, getLocale());
}

@Override
public Locale getLocale() {
return mLocale;
}

@Override
public String getSpaceKeyText(String aComposingText) {
return StringUtils.getStringByLocale(mContext, R.string.settings_language_finnish, getLocale());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.mozilla.vrbrowser.input.CustomKeyboard;
import org.mozilla.vrbrowser.telemetry.TelemetryWrapper;
import org.mozilla.vrbrowser.ui.keyboards.DanishKeyboard;
import org.mozilla.vrbrowser.ui.keyboards.FinnishKeyboard;
import org.mozilla.vrbrowser.ui.keyboards.DutchKeyboard;
import org.mozilla.vrbrowser.ui.keyboards.ItalianKeyboard;
import org.mozilla.vrbrowser.ui.keyboards.FrenchKeyboard;
Expand Down Expand Up @@ -188,6 +189,7 @@ private void initialize(Context aContext) {
mKeyboards.add(new JapaneseKeyboard(aContext));
mKeyboards.add(new PolishKeyboard(aContext));
mKeyboards.add(new DanishKeyboard(aContext));
mKeyboards.add(new FinnishKeyboard(aContext));
mKeyboards.add(new DutchKeyboard(aContext));

mDefaultKeyboardSymbols = new CustomKeyboard(aContext.getApplicationContext(), R.xml.keyboard_symbols);
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/dimen.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<dimen name="keyboard_height">188dp</dimen>
<dimen name="keyboard_alphabetic_width">526dp</dimen>
<dimen name="keyboard_alphabetic_width_danish">540dp</dimen>
<dimen name="keyboard_alphabetic_width_finnish">540dp</dimen>
<dimen name="keyboard_alphabetic_width_extra_column">564dp</dimen>
<dimen name="keyboard_numeric_width">144dp</dimen>
<dimen name="keyboard_zhuyin_height">250dp</dimen>
Expand Down
16 changes: 16 additions & 0 deletions app/src/main/res/values/non_L10n.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
<string name="language_it_IT" translatable="false">Italiano</string>
<string name="language_pl_PL" translatable="false">Polski</string>
<string name="language_da_DK" translatable="false">Dansk</string>
<string name="language_fi_FI" translatable="false">Suomea</string>
<string name="language_nl_NL" translatable="false">Nederlands</string>

<string name="pinyin_spacebar_selection" translatable="false">选定</string>
Expand Down Expand Up @@ -150,6 +151,21 @@
<string name="keyboard_da_DK_popup_ø" translatable="false">øö</string>
<string name="keyboard_da_DK_popup_n" translatable="false">nñń</string>

<!-- Keyboard Finnish -->
<string name="keyboard_fi_FI_popup_a" translatable="false">aæàáâãā</string>
<string name="keyboard_fi_FI_popup_d" translatable="false">dđ</string>
<string name="keyboard_fi_FI_popup_e" translatable="false">eéèëê</string>
<string name="keyboard_fi_FI_popup_s" translatable="false">sšßś</string>
<string name="keyboard_fi_FI_popup_t" translatable="false">tŧ</string>
<string name="keyboard_fi_FI_popup_u" translatable="false">uüûū</string>
<string name="keyboard_fi_FI_popup_z" translatable="false">zžźż</string>
<string name="keyboard_fi_FI_popup_c" translatable="false">cç</string>
<string name="keyboard_fi_FI_popup_o" translatable="false">oøôóòõœō</string>
<string name="keyboard_fi_FI_popup_i" translatable="false">iíïìîįī</string>
<string name="keyboard_fi_FI_popup_ö" translatable="false">öø</string>
<string name="keyboard_fi_FI_popup_ä" translatable="false">äæ</string>
<string name="keyboard_fi_FI_popup_n" translatable="false">nŋñ</string>

<!-- Keyboard Dutch -->
<string name="keyboard_nl_NL_popup_e" translatable="false">eéëêèęėēěĕə</string>
<string name="keyboard_nl_NL_popup_a" translatable="false">aáäâàæãåāăą</string>
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/values/options_values.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
<item>@string/language_it_IT</item>
<item>@string/language_da_DK</item>
<item>@string/language_pl_PL</item>
<item>@string/language_fi_FI</item>
<item>@string/language_nl_NL</item>
</string-array>

Expand All @@ -114,6 +115,7 @@
<item>it-IT</item>
<item>da-DK</item>
<item>pl-PL</item>
<item>fi-FI</item>
<item>nl-NL</item>
</string-array>

Expand All @@ -132,6 +134,7 @@
<item>@string/language_it_IT</item>
<item>@string/language_da_DK</item>
<item>@string/language_pl_PL</item>
<item>@string/language_fi_FI</item>
<item>@string/language_nl_NL</item>
</string-array>

Expand All @@ -149,6 +152,7 @@
<item>it-IT</item>
<item>da-DK</item>
<item>pl-PL</item>
<item>fi-FI</item>
<item>nl-NL</item>
</string-array>

Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@
<string name="settings_language_danish">Danish</string>

<!-- This string is used to label a radio button in the settings language dialog that, when pressed,
changes the app and the language of the speech-recognition-based search to 'Finnish'. -->
<string name="settings_language_finnish">Finnish</string>

<!-- This string is used to label a radio button in the settings language dialog that, when pressed,
changes the app and the language of the speech-recognition-based search to 'Dutch'. -->
<string name="settings_language_dutch">Dutch</string>

Expand Down
62 changes: 62 additions & 0 deletions app/src/main/res/xml/keyboard_qwerty_finnish.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
android:horizontalGap="@dimen/keyboard_horizontal_gap"
android:verticalGap="@dimen/keyboard_vertical_gap"
android:keyWidth="@dimen/keyboard_key_width"
android:keyHeight="@dimen/keyboard_key_height">
<Row>
<Key android:codes="113" android:keyLabel="q" android:keyEdgeFlags="left" android:popupKeyboard="@xml/keyboard_popup" android:popupCharacters="@string/keyboard_popup_q" android:horizontalGap="@dimen/keyboard_left_margin_half" />
<Key android:codes="119" android:keyLabel="w" android:popupCharacters="@string/keyboard_popup_w" android:popupKeyboard="@xml/keyboard_popup" />
<Key android:codes="101" android:keyLabel="e" android:popupCharacters="@string/keyboard_fi_FI_popup_e" android:popupKeyboard="@xml/keyboard_popup" />
<Key android:codes="114" android:keyLabel="r" android:popupCharacters="@string/keyboard_popup_r" android:popupKeyboard="@xml/keyboard_popup" />
<Key android:codes="116" android:keyLabel="t" android:popupCharacters="@string/keyboard_fi_FI_popup_t" android:popupKeyboard="@xml/keyboard_popup" />
<Key android:codes="121" android:keyLabel="y" android:popupCharacters="@string/keyboard_popup_y" android:popupKeyboard="@xml/keyboard_popup" />
<Key android:codes="117" android:keyLabel="u" android:popupCharacters="@string/keyboard_fi_FI_popup_u" android:popupKeyboard="@xml/keyboard_popup" />
<Key android:codes="105" android:keyLabel="i" android:popupCharacters="@string/keyboard_fi_FI_popup_i" android:popupKeyboard="@xml/keyboard_popup" />
<Key android:codes="111" android:keyLabel="o" android:popupCharacters="@string/keyboard_fi_FI_popup_o" android:popupKeyboard="@xml/keyboard_popup" />
<Key android:codes="112" android:keyLabel="p" android:popupCharacters="@string/keyboard_popup_p" android:popupKeyboard="@xml/keyboard_popup" />
<Key android:keyOutputText="å" android:keyLabel="å"/>
<Key android:codes="-5" android:keyIcon="@drawable/ic_icon_keyboard_backspace" android:isRepeatable="true" android:keyWidth="@dimen/keyboard_key_backspace_width" />
</Row>

<Row>
<Key android:codes="97" android:keyLabel="a" android:popupCharacters="@string/keyboard_fi_FI_popup_a" android:popupKeyboard="@xml/keyboard_popup" android:keyEdgeFlags="left" />
<Key android:codes="115" android:keyLabel="s" android:popupCharacters="@string/keyboard_fi_FI_popup_s" android:popupKeyboard="@xml/keyboard_popup" />
<Key android:codes="100" android:keyLabel="d" android:popupCharacters="@string/keyboard_fi_FI_popup_d" android:popupKeyboard="@xml/keyboard_popup"/>
<Key android:codes="102" android:keyLabel="f" android:popupCharacters="@string/keyboard_popup_f" android:popupKeyboard="@xml/keyboard_popup" />
<Key android:codes="103" android:keyLabel="g" android:popupCharacters="@string/keyboard_popup_g" android:popupKeyboard="@xml/keyboard_popup"/>
<Key android:codes="104" android:keyLabel="h" android:popupCharacters="@string/keyboard_popup_h" android:popupKeyboard="@xml/keyboard_popup"/>
<Key android:codes="106" android:keyLabel="j" android:popupCharacters="@string/keyboard_popup_j" android:popupKeyboard="@xml/keyboard_popup"/>
<Key android:codes="107" android:keyLabel="k" android:popupCharacters="@string/keyboard_popup_k" android:popupKeyboard="@xml/keyboard_popup"/>
<Key android:codes="108" android:keyLabel="l" android:popupCharacters="@string/keyboard_popup_l" android:popupKeyboard="@xml/keyboard_popup" />
<Key android:keyOutputText="ö" android:keyLabel="ö" android:popupCharacters="@string/keyboard_fi_FI_popup_ö" android:popupKeyboard="@xml/keyboard_popup" />
<Key android:keyOutputText="ä" android:keyLabel="ä" android:popupCharacters="@string/keyboard_fi_FI_popup_ä" android:popupKeyboard="@xml/keyboard_popup"/>
<Key android:codes="-4" android:keyLabel="@string/keyboard_enter_label" android:keyWidth="@dimen/keyboard_key_enter_width_small" />
</Row>

<Row>
<Key android:codes="-1" android:keyIcon="@drawable/ic_icon_keyboard_shift_off" android:keyEdgeFlags="left" android:horizontalGap="@dimen/keyboard_left_margin" />
<Key android:codes="122" android:keyLabel="z" android:popupCharacters="@string/keyboard_fi_FI_popup_z" android:popupKeyboard="@xml/keyboard_popup"/>
<Key android:codes="120" android:keyLabel="x" android:popupCharacters="@string/keyboard_popup_x" android:popupKeyboard="@xml/keyboard_popup"/>
<Key android:codes="99" android:keyLabel="c" android:popupCharacters="@string/keyboard_fi_FI_popup_c" android:popupKeyboard="@xml/keyboard_popup"/>
<Key android:codes="118" android:keyLabel="v" android:popupCharacters="@string/keyboard_popup_v" android:popupKeyboard="@xml/keyboard_popup" />
<Key android:codes="98" android:keyLabel="b" android:popupCharacters="@string/keyboard_popup_b" android:popupKeyboard="@xml/keyboard_popup" />
<Key android:codes="110" android:keyLabel="n" android:popupCharacters="@string/keyboard_fi_FI_popup_n" android:popupKeyboard="@xml/keyboard_popup" />
<Key android:codes="109" android:keyLabel="m" android:popupCharacters="@string/keyboard_popup_m" android:popupKeyboard="@xml/keyboard_popup" />
<Key android:codes="45" android:keyLabel="-" />
<Key android:codes="43" android:keyLabel="+" />
<Key android:codes="47" android:keyLabel="/" />
<Key android:codes="-1" android:keyIcon="@drawable/ic_icon_keyboard_shift_off" />
</Row>

<Row>
<Key android:codes="-2" android:keyLabel="%&amp;=" android:keyEdgeFlags="left" android:horizontalGap="@dimen/keyboard_left_margin"/>
<Key android:codes="-12" android:keyIcon="@drawable/ic_icon_keyboard_globe" />
<Key android:codes="32" android:keyLabel="" android:keyWidth="@dimen/keyboard_key_space_width" android:isRepeatable="true"/>
<Key android:codes="44" android:keyLabel=","/>
<Key android:codes="46" android:keyLabel="."/>
<Key android:codes="33" android:keyLabel="!" android:popupCharacters="!¡" android:popupKeyboard="@xml/keyboard_popup" />
<Key android:codes="63" android:keyLabel="\?" android:popupCharacters="\?¿" android:popupKeyboard="@xml/keyboard_popup" />
<Key android:codes="64" android:keyLabel="\@"/>
</Row>
</Keyboard>
62 changes: 62 additions & 0 deletions app/src/main/res/xml/keyboard_symbols_finnish.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
android:horizontalGap="@dimen/keyboard_horizontal_gap"
android:verticalGap="@dimen/keyboard_vertical_gap"
android:keyWidth="@dimen/keyboard_key_width"
android:keyHeight="@dimen/keyboard_key_height">
<Row>
<Key android:codes="8364" android:keyLabel="€" android:keyEdgeFlags="left" android:horizontalGap="@dimen/keyboard_left_margin_half"/>
<Key android:codes="163" android:keyLabel="£"/>
<Key android:codes="165" android:keyLabel="¥"/>
<Key android:codes="36" android:keyLabel="$"/>
<Key android:codes="199" android:keyLabel="ç"/>
<Key android:codes="37" android:keyLabel="%"/>
<Key android:codes="38" android:keyLabel="&amp;"/>
<Key android:codes="40" android:keyLabel="("/>
<Key android:codes="41" android:keyLabel=")"/>
<Key android:codes="61" android:keyLabel="="/>
<Key android:codes="61" android:keyLabel="_"/>
<Key android:codes="-5" android:keyIcon="@drawable/ic_icon_keyboard_backspace" android:isRepeatable="true" android:keyWidth="@dimen/keyboard_key_backspace_width"/>
</Row>

<Row>
<Key android:codes="186" android:keyLabel="º" android:keyEdgeFlags="left"/>
<Key android:codes="94" android:keyLabel="^" />
<Key android:codes="167" android:keyLabel="§" />
<Key android:codes="123" android:keyLabel="{"/>
<Key android:codes="125" android:keyLabel="}"/>
<Key android:codes="91" android:keyLabel="["/>
<Key android:codes="93" android:keyLabel="]"/>
<Key android:codes="124" android:keyLabel="|"/>
<Key android:codes="59" android:keyLabel=";"/>
<Key android:codes="58" android:keyLabel=":"/>
<Key android:codes="34" android:keyLabel="•"/>
<Key android:codes="-4" android:keyLabel="@string/keyboard_enter_label" android:keyWidth="@dimen/keyboard_key_enter_width_small" />
</Row>

<Row>
<Key android:codes="-1" android:keyIcon="@drawable/ic_icon_keyboard_shift_on" android:keyEdgeFlags="left" android:horizontalGap="@dimen/keyboard_left_margin"/>
<Key android:codes="60" android:keyLabel="&lt;"/>
<Key android:codes="62" android:keyLabel="&gt;"/>
<Key android:codes="39" android:keyLabel="`"/>
<Key android:codes="126" android:keyLabel="~"/>
<Key android:codes="39" android:keyLabel="´"/>
<Key android:codes="34" android:keyLabel="&quot;"/>
<Key android:codes="58" android:keyLabel="\\"/>
<Key android:codes="45" android:keyLabel="-" />
<Key android:codes="43" android:keyLabel="+" />
<Key android:codes="47" android:keyLabel="/" />
<Key android:codes="-1" android:keyIcon="@drawable/ic_icon_keyboard_shift_on" />
</Row>

<Row>
<Key android:codes="-2" android:keyLabel="@string/keyboard_mode_change" android:keyEdgeFlags="left" android:horizontalGap="@dimen/keyboard_left_margin" />
<Key android:codes="-12" android:keyIcon="@drawable/ic_icon_keyboard_globe" />
<Key android:codes="32" android:keyLabel="" android:keyWidth="@dimen/keyboard_key_space_width" android:isRepeatable="true"/>
<Key android:codes="44" android:keyLabel=","/>
<Key android:codes="46" android:keyLabel="."/>
<Key android:codes="33" android:keyLabel="!" android:popupCharacters="!¡" android:popupKeyboard="@xml/keyboard_popup" />
<Key android:codes="63" android:keyLabel="\?" android:popupCharacters="\?¿" android:popupKeyboard="@xml/keyboard_popup" />
<Key android:codes="64" android:keyLabel="\@"/>
</Row>
</Keyboard>