Skip to content

Add cross-platform device language preferences - #29

Merged
tifroz merged 1 commit into
skiptools:mainfrom
tifroz:codex/device-language-preferences
Dec 4, 2026
Merged

tifroz merged 1 commit into
skiptools:mainfrom
tifroz:codex/device-language-preferences

Conversation

@tifroz

@tifroz tifroz commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Thank you for contributing to the Skip project! Please use this space to describe your change and add any labels (bug, enhancement, documentation, etc.) to help categorize your contribution.

Please review the contribution guide at https://skip.dev/docs/contributing/ for advice and guidance on making high-quality PRs.

Skip Pull Request Checklist:

  • REQUIRED: I have tested my change locally with swift test
  • OPTIONAL: I have tested my change on an iOS simulator or device
  • OPTIONAL: I have tested my change on an Android emulator or device

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes.

Codex generated the code, manually validated from a fuse app on android + ios


Summary

Add DeviceLanguagePreferences.current so callers can read the user's preferred languages through SkipDevice on Apple platforms and Android. It forwards Locale.preferredLanguages and preserves the platform's order.

Raise the minimum skip-foundation version from 1.2.17 to 1.4.6, the first release that provides this property on Android. Callers already using Foundation can access the same list directly. skip-foundation change

Usage Example

import SkipDevice

let languages = DeviceLanguagePreferences.current
// For example, ["en-US", "fr-CA"] with US English preferred.

API Shape

public final class DeviceLanguagePreferences {
    public static var current: [String] { get }
}

Testing

Ran the package tests from a clean checkout with published dependencies, resolving skip-foundation 1.5.0.

  • macOS XCTest cases: 9 passed, 1 skipped.
  • Android 17 on a Samsung SM-S721U: 10 passed, 1 skipped.

testDeviceLanguagePreferencesAreAvailable passed on both platforms. It checks that the list is nonempty and equals Locale.preferredLanguages in order. The existing location test is skipped on both platforms.

Limitations

The test uses each device's current preferences. It does not set up a specific multilingual list or change languages during the test.

@tifroz
tifroz merged commit 4312451 into skiptools:main Dec 4, 2026
2 checks passed
@tifroz
tifroz deleted the codex/device-language-preferences branch December 4, 2026 22:36
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

Successfully merging this pull request may close these issues.

1 participant