To avoid issues like T342447, the list of right-to-left languages should be automatically generated in MobileFrontend. Preferably, it should happen automatically on-the-fly (but with sufficient caching to avoid performance regression); if it’s impossible, a bot (like Translation updater bot or or libraryupgrader) could be used.
Package files are parts of ResourceLoader modules, and as such, cached more aggressively. Even if including the directionality directly in the links causes an unacceptable performance regression, including the list of RTL languages in a ResourceLoader module may have acceptable performance.