fix: properly handle installer language changes#1746
Conversation
|
According to the PR's description, looks to me you're working on https://trello.com/c/isE3194l/620-agama-translations-not-working-consitently too. Please, have a look. Thanks for addressing these translation issues. |
c98259a to
4145587
Compare
| #[proxy( | ||
| default_service = "org.opensuse.Agama1", | ||
| default_service = "org.opensuse.Agama.Manager1", | ||
| default_path = "/org/opensuse/Agama/Manager1", |
There was a problem hiding this comment.
Good catch... except it does not work: 🤣 😢
When I run this code and change the UI langue in the browser, journalctl has:
Nov 12 13:10:23 c75fbede8655 agama-web-server[28278]: Sending message: Msg { type: MethodCall, serial: 157, sender: UniqueName(":1.7"), path: ObjectPath("/org/freedesktop/Locale"), iface: InterfaceName("org.freedesktop.DBus.Properties"), member: MemberName("Set"), body: Structure(Dynamic { fields: [Str, Str, Variant] }), fds: [] }
...
Nov 12 13:10:23 c75fbede8655 agama-web-server[28278]: 5:185m5:185mCould not synchronize settings in the localization D-Bus service: D-Bus service error: org.freedesktop.DBus.Error.UnknownObject: Unknown object '/org/freedesktop/Locale'
Looking up "Could not synchronize settings" in the source, I arrive at a update_dbus fn, which uses a set_locales fn, defined in...
Which is a similar, yet different file from this diff
🤷
There was a problem hiding this comment.
Well, it works for me (TM) 😉 Actually, I would not expect the set_locales method to be involved because that's responsible for changing the locales to install, not the installer's language. Are you changing the language through the "Installer Options" menu? Did you restart the agama-dbus-server process too (restarting the agama.service should be enough)?
Having two interfaces with the same name (org.opensuse.Agama1.Locale) is unfortunate, I know, but they are different things:
- localization/proxies refers to the Locale API (implemented in
agama-dbus-server). We kept a D-Bus interface because it was needed for internal communication. But the idea is to get rid of it and rely only on HTTP. - proxies/locale refers to an interface that is implemented by all Ruby-based services which allows to change the language.
I wonder if we should add default_path = "/org/opensuse/Agama1/Locale", to the 1st proxy, but in my testing system it seems to work (unless I am missing something).
In any case, I will build an image that includes all the changes so we can perform more tests.
There was a problem hiding this comment.
I have fixed both proxies and now I see no error in the logs.
There was a problem hiding this comment.
Having two interfaces with the same name (org.opensuse.Agama1.Locale) is unfortunate, I know, but they are different things:
It's not unfortunate, it is wrong 😄 but it happens to work now. I hope I can add a simple fix, otherwise postpone it for another PR
There was a problem hiding this comment.
Yes, it is wrong 😅 The point is that we plan to drop one of them, so it won't be duplicated anymore.
Pull Request Test Coverage Report for Build 11825620593Details
💛 - Coveralls |
it has only a SetLocale method, used as a mixin, to localize the output of various components, but it collided with org.opensuse.Agama1.Locale which is the main locale config for the system
mvidner
left a comment
There was a problem hiding this comment.
My manual language switching test works now
(after installing missing packages to my container, will fix that in another PR)
I can't really review the JS/TS code... it looks well formed to me 👍
Update to release version 11. * #1495 * #1564 * #1617 * #1618 * #1625 * #1626 * #1627 * #1628 * #1630 * #1631 * #1632 * #1633 * #1634 * #1635 * #1636 * #1639 * #1640 * #1641 * #1642 * #1643 * #1644 * #1645 * #1646 * #1647 * #1648 * #1649 * #1650 * #1651 * #1652 * #1654 * #1655 * #1656 * #1657 * #1660 * #1663 * #1666 * #1667 * #1668 * #1670 * #1671 * #1673 * #1674 * #1675 * #1676 * #1677 * #1681 * #1682 * #1683 * #1684 * #1687 * #1688 * #1689 * #1690 * #1691 * #1692 * #1693 * #1694 * #1695 * #1696 * #1698 * #1699 * #1702 * #1703 * #1704 * #1705 * #1707 * #1708 * #1709 * #1710 * #1711 * #1712 * #1713 * #1714 * #1715 * #1716 * #1717 * #1718 * #1720 * #1721 * #1722 * #1723 * #1727 * #1728 * #1729 * #1731 * #1732 * #1733 * #1734 * #1735 * #1736 * #1737 * #1740 * #1741 * #1743 * #1744 * #1745 * #1746 * #1751 * #1753 * #1754 * #1755 * #1757 * #1762 * #1763 * #1764 * #1765 * #1766 * #1767 * #1769 * #1771 * #1772 * #1773 * #1774 * #1777 * #1778 * #1785 * #1786 * #1787 * #1788 * #1789 * #1790 * #1791 * #1792 * #1793 * #1794 * #1795 * #1796 * #1797 * #1798 * #1799 * #1800 * #1802 * #1803 * #1804 * #1805 * #1807 * #1808 * #1809 * #1810 * #1811 * #1812 * #1814 * #1815 * #1821 * #1822 * #1823 * #1824 * #1825 * #1826 * #1827 * #1828 * #1830 * #1831 * #1832 * #1833 * #1834 * #1835 * #1836 * #1837 * #1838 * #1839 * #1840 * #1841 * #1842 * #1843 * #1844 * #1845 * #1847 * #1848 * #1849 * #1850 * #1851 * #1854 * #1855 * #1856 * #1857 * #1860 * #1861 * #1863 * #1864 * #1865 * #1866 * #1867 * #1871 * #1872 * #1873 * #1875 * #1876 * #1877 * #1878 * #1880 * #1881 * #1882 * #1883 * #1884 * #1885 * #1886 * #1888 * #1889 * #1890
## Problem At mid-term, we would like to get rid of the `agama-dbus-server` binary. For that, we need to drop the `org.opensuse.Agama1.Locale` and `org.opensuse.Agama1.Questions` interfaces from D-Bus. ## Solution This PR removes the `org.opensuse.Agama1.Locale`. This D-Bus interface only existed to make it possible for D-Bus service to get the current locales configuration. After changing the approach to the [`org.opensuse.Agama1.LocaleMixin` approach](#1746), it is not needed anymore. ## Testing - [x] Update unit tests. - [x] Test manually.
Problem
Problems:
pt-BR).es_ARdoes not fallback toes_ES, it uses English instead #860Solution
Fix the D-Bus path of the LocaleProxy to the Manager's
org.opensuse.Agama1.Localeinterface.Testing