Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install correct dictionary automatically #70

Open
yamanq opened this issue Jan 28, 2023 · 0 comments
Open

Install correct dictionary automatically #70

yamanq opened this issue Jan 28, 2023 · 0 comments

Comments

@yamanq
Copy link

yamanq commented Jan 28, 2023

Describe the bug

When installing the app, dictionaries are automatically installed as solved by #69. However, these are the wrong dictionaries for my installation's locale. I was personally able to fix the issue by installing the right dictionary, but this should be done automatically.

Context

  • YunoHost version: 11.0.10.2
  • I have access to my server: Through SSH
  • Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: no special case
  • Using, or trying to install package version/branch: 22.05.8.2~ynh2

Steps to reproduce

  1. Install app on locale that is not en-uk, de-de or fr.
  2. Open Collabora and note that spelling correction is not enabled/correct.

Expected behavior

The correct hunspell dictionaries should be installed

Potential solution

Since locale gives the current locale of the user, we can use that to determine the write hunspell package. However, we also need to install apt-file so that we can find the right hunspell package.

apt install apt-file
apt-file update
dictionary=$(apt-file search --package-only "/usr/share/hunspell/$(echo $LANG | cut -d '.' -f 1).dic")
apt install $dictionary

I am not sure exactly how to port this to yunohost conventions (ynh_package_install?) but I think this is a good start to get spelling correction working on all locales:

ynh_package_install apt-file
apt-file update
dictionary=$(apt-file search --package-only "/usr/share/hunspell/$(echo $LANG | cut -d '.' -f 1).dic")
ynh_install_app_dependencies "$dictionary"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant