Add language pack for anysoftkeboard - android-softkeyboard

I'm now trying to add a new language for Anysoftkeyboard.
But I don't quite sure how create a language wordlist and make it a language package for Anysoftkeyboard.
I'm now creating a Binary Dictionaries as this URL but don't know what the next step is.
Could anyone be so kind to tell me the steps of add a new language to AnysoftKeyboard?
Besides I download the database from here and what I trying to add is Chinese and Vietnamese.
Other method for making a Android softkeyboard is also appreciated.

You can create an android app language pack for AnySoftKeyboard https://github.com/azzamsa/LanguagePack

You need to put the new binary dictionary in the assets/path, and add a similar entry into res/xml/dictionaries.xml: dictionaryAssertName="dict.mp3".
You may find a full example of a language pack here :
https://github.com/ludovig/vimboard/tree/master/android-vimboard-ask
I'm using AIDE to clone package and build it on my android device.

Related

Flutter: Localization from API call

I wish to localize a Flutter application where locales are fetched by an API call, given the requested language.
I was hoping to be able to use the Intl package or something similar, but I am not sure this is possible without the .arb files.
Any ideas on how to accomplish this without reinventing the wheel?
(Having the localizations stored locally is not an option)
Down below, you can see a class which is converted to a singleton pattern. You can use any service locator package. It will be the same thing.
Now you can call this class in your main function, default set to EN.
Now let's say, you want to support SPANISH and not want to use .arb files
Now you can call google translate and replace values with the existing one. for every variable. I hope this helps.
Use https://pub.dev/packages/localizely_sdk package, it provides what you want to achieve
Turns out easy_localization has the functionality described. Simply creating a custom HttpAssetLoader and passing it to the easy_localization initialization method works out of the box, and provides device language detection, and application rebuild on locale change as intended.

Call a Dart const from a String version of its name

I am using Flutter and the FontAwesome library and I need to create icons based on their name. So, I need to get the following:
FaIcon(FontAwesomeIcons.lightWalking);
...but from its name as a String.
Something like this:
FaIcon(FontAwesomeIcons["lightWalking"]); // <== this doesn't work in Dart
I can then build a function to return icons based on the name that I get out of a database.
I don't think this is a dart related question on first sight but rather a FontAwesomeIcons question unless you want to use reflection in dart. You need to access the Icons here which are simply not accessible the way you tried it.
See the following issue:
https://github.com/fluttercommunity/font_awesome_flutter/issues/102
Quote:
Hi, we don't support icon maps officially, but you can use this
generator by calling it in the updater tool. You will need a local
installation of font awesome for this, please follow the instructions
for pro icons and ignore steps that mention icons.json or .ttf files.
If you need further assistance feel free to ask.
That means the way you are trying to access your icons is not supported directly.
However you could use the generator tools to create such a map, iterate it and find a suitable icon. See the FontAwesome example for that (they generated a map and iterated it).
https://github.com/fluttercommunity/font_awesome_flutter/tree/master/example/lib
What might be a little more convenient might be a third party tool which already has such a map and allows you to search it.
https://pub.dev/packages/icons_helper/example
You can then do the following:
getIconUsingPrefix(name: "PREFIX.ICON_NAME")
You can achieve this only using reflection. There is a library called reflectable for Flutter. It will generate some code for you and then you will be able to access the class members of FontAwesomeIcons by their name as String.

Is there a strings or language file I can add to an Ionic project?

How can I make a language/string file and reference it in the HTML and code base?
It would help reduce spelling errors, make it easy to change in one place, and easier to translate.
Kind of like android studio's strings.xml.
Thanks.
It depends on the javascript framework that you're using behind the ionic-framework.
In case of angular , you can consider the ngx-translate , once you configure it , you can put your strings inside a json file , and you'll be using the keys to match the translations/full-text.

Create an App within an App

I am being presented with a very interesting project. The task that I must complete is to figure out a way to allow a partner to be involved in an app without giving up their source code. The code will be included in the main bundle of the app so it is not dynamically stored. The partner has a fully functional app that is needed to be ran in a window within the main app at the appropriate time. I know having the partners create a web app would be ideal so it is treated like a webpage but I am more concerned with codes that must be written natively in iOS.
My question is what is the best way to go about solving this? In theory it is like an App within an App. Is there a way if they gave up their .app file I can include this in the bundle and then run it when I catch a certain event? Should I have the partners create their code in a framework and then import into the shell project? What is the best way to approach this problem?
If your 2nd-party doesn't want to provide you with the source code, why doesn't he compile it to object code then let you simply link it to your app?
By the way, at least on official (non-jailbroken) iDevices, apps can't 'embed' or 'open' one another in such a way - you can open an app programmatically if 1. it's a separate app 2. it has a registered special URL associated to its bundle.
Is there a way if they gave up their .app file I can include this in
the bundle and then run it when I catch a certain event?
No, you'll want to have them create a library instead. You can then include that library in your project.
Creating a library is as simple as:
Choose File->New...->Project... in Xcode.
Select the "Cocoa Touch Static Library" project template.
Add your code.
Build.
The result is a static library that you can add to your application(s). The library will contain the compiled code that you added, but doesn't include the source code. The library developer should provide whatever header files are necessary to use the code in the library.
An App within an App is possible however it requires a common data framework that allows one app to reference the same data without confusing the the source of and destination of the data.
Such a framework allows one app to interact with another app referencing the same data.

make the language of my IPHONE app change from the app settings without changing the language of the device

I want to make the language changeable from the application settings. For that I made a settings.bundle and i forced the langauge using this code How to force NSLocalizedString to use a specific language , I also put the UIApplicationExitsOnSuspend to YES to make my app reload every time it goes to the background.
It partially worked for me but I have 2 problems :
- The splash screen (which is localized) is not changing with this method.
- I must enter/goBack twice to make the language change effective on the application Views an this only on the OS 4 and higher.
Has anyone a solution for that?
You need to create you own translation framework for that ! Sorry !
Unfortunately there's no built-in way. What would be probably easiest would be integrate service like GetLocalization.com, so that your app would download language file via API (then it's easy to add new languages and translations even app is already released). Then what you need is just simple loader that loads that language file to memory and function that replaces the original string with translated one in run-time. You can calculate hash for original string so it's fast to search them, good algorithm for this is Peter Weinberger's hashPJW.
The trick to use specific language by selecting it from the app is to force the NSLocalizedString to use specific bundle depending on the selected language ,
here is the post i have written for this http://learning-ios.blogspot.com/2011/04/advance-localization-in-ios-apps.html
and here is the code of one sample app https://github.com/object2dot0/Advance-Localization-in-ios-apps