Closed Petrakeas closed 7 months ago
Hi :) Yes, Tooltips & content descriptions are currently not supported by Reword. However this should be easy to implement, I might do it if I find the time. If this is something you need right now, feel free to create a PR though. I think you can likely copy from your own library ;)
Reword does handle menu items, just have a look at its sample app, it uses multiple menus. If you think there is a bug, please fork this repository and change the sample app so that it reproduces the problem, then create an issue referencing your fork.
Regarding support of the navigation library used with XML I currently have no plans of supporting this. I think this might be a lot of effort. But if you already have an idea, feel free to create a PR. If not I would recommend to just set the title normally in code like it is done in the sample app.
Do you use Reword in an app actively, or are you just trying things out?
Regarding menu items, it seems that using the "app:menu" toobar attribute is required for reword to handle them. I was using the override method and the strings did not pass through reword:
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
inflater.inflate(R.menu.main_menu, menu);
super.onCreateOptionsMenu(menu,inflater);
}
I don't use Reword. I am using ViewPump and recently I moved from the original version of the library to your version. I have my own ViewTransformers and ResourceWrapper for handling translations. It seems that Reword's transformers handle more cases and also support menus. So, I was thinking of moving to Reword and supply my own Resources wrapper. I won't be using ReString.
Yes, intercepting the MenuInflater
is not supported at the moment. If this is something you need feel free to create a PR for it, but I think the "app:menu" approach is far more common anyway.
I think you are right in that Reword would suit your approach of using your own Resources wrapper better then Restring. Restring is mainly intended for use cases where you only want to customize how the string resources which you want to replace are stored.
Using the following view:
I was expecting the tooltip text to be handled by reword.
I have this functionality in a similar library as reword . You can get ideas for implementation from here.
I also noticed two other areas that reword does not work. You may have figured this out yourself, but I haven't found a solution.
Reword does not handle menu items.
Also, when the
androidx.appcompat.widget.Toolbar
title is provided by navgraph via the "android:label" attribute.