패키지, 저장소 및 앱 카테고리 검색

패키지 상세v2.0.0

locale_plus

LocalePlus는 Flutter 앱에서 네이티브 디바이스 로케일 데이터에 쉽게 접근할 수 있도록 도와줍니다. 언어, 국가 코드, 시간대 및 숫자 형식화 설정을 포함합니다.

AndroidiOS
30일 다운로드
6.5천
좋아요
33
Pub 점수
140

패키지 설치

flutter pub add locale_plus

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

LocalePlus는 언어, 국가 코드, 시간대, 숫자 형식화 선호도를 포함한 네이티브 기기 로케일 정보에 원활하게 액세스할 수 있도록 해주는 Flutter 패키지입니다. 복잡한 설정 없이 시스템 레벨의 로케일 데이터를 가져와서 로컬라이제이션을 단순화합니다. 동적 콘텐츠 렌더링, 날짜/시간 표시, 통화 형식화에 정확한 지역 설정이 필요한 앱에 적합합니다. 이 패키지는 Flutter의 국제화 프레임워크와 원활하게 통합되며 Android 및 iOS 플랫폼 모두를 지원합니다.

사용 사례

  • 사용자 지역에 기반한 동적 UI
  • 로컬화된 날짜 및 시간 표시
  • 숫자 및 통화 형식 지정
  • 다국어 앱 지원
  • 로케일에 따라 앱 동작 조정
  • 지역 설정을 통한 접근성 향상

주요 기능

  • 기기 고유의 로케일 데이터를 검색합니다
  • 언어, 국가, 시간대 및 서식 지정을 지원
  • 최소 설정으로 간단한 API
  • 크로스 플랫폼(안드로이드 및 iOS)
  • 경량이며 종속성 없음
  • 사용자의 선호하는 로케일을 자동으로 감지

적합한 대상

  • 지역 맞춤이 필요한 앱
  • 국제화된 애플리케이션
  • 금융 또는 여행 앱
  • 로컬라이제이션 필요성이 있는 사용자 중심 앱
  • 빠른 로케일 접근을 원하는 개발자
  • Flutter의 i18n 기능을 사용하는 프로젝트

고려 사항

  • 기기 시스템 설정에 의존합니다
  • 번역 문자열을 처리하지 않습니다
  • 로케일 데이터 읽기만 가능
  • 내장된 백업 메커니즘이 없음
  • 로케일 변경을 수동으로 처리해야 합니다
  • 단독으로는 완전한 i18n 워크플로우에 적합하지 않습니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

Locale Plus

LocalePlus allows easy access to native device locale data in Flutter apps. Includes language, country code, time zone, and number formatting preferences.

Table of Content

Overview

LocalePlus is a Flutter package that allows developers to easily retrieve data from the native device locale settings. With LocalePlus, developers can access information such as the device's language, country code, and time zone, as well as the device's number formatting preferences such as grouping and decimal separator. This makes it easy to build internationalized apps that provide a personalized experience for each user. Whether you're building a financial app that needs to display numbers in the user's local format or a social media app that needs to display timestamps in the user's time zone, LocalePlus has you covered. With a simple and intuitive API, LocalePlus is the perfect tool for any Flutter developer looking to add localization to their app.

Requirements

  • Dart sdk: ">=3.10.0 <4.0.0"
  • Flutter: ">=3.38.0"
  • Android: minSdkVersion 16
  • iOS 13.0+

The iOS plugin supports both Swift Package Manager and CocoaPods.

Installation

with Flutter:

$ flutter pub add locale_plus

This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):

dependencies:
  locale_plus: ^2.0.0

Usage

Patch the locales with the users' group and decimal seperators

This function patches all locales in flutter, so that you can use the decimal seperator and group seperator from numberFormatSymbols after the patch is complete. The patchNumberSeperators function patches the locales on android and ios. The shouldPatchForSamsungKeyboard can be enabled, to patch for Samsung keyboards on android phones (they only allow for a . as input). It is safe to call on MacOS, Windows, Linux and web, but it does not patch the locales.

import 'package:locale_plus/locale_plus.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await PatchAllLocales.patchNumberSeperators(
    shouldPatchForSamsungKeyboard: true,
  );
  runApp(const MyApp());
}

Get if the user is using a samsung keyboard

final decimalSeparator = await LocalePlus().isUsingSamsungKeyboard();

Get Decimal & Grouping Separator

final decimalSeparator = await LocalePlus().getDecimalSeparator();
final groupingSeparator = await LocalePlus().getGroupingSeparator();

Get Language & Region Code

final regionCode = await LocalePlus().getRegionCode();
final languageCode = await LocalePlus().getLanguageCode();

Get Seconds from GMT

final secondsFromGMT = await LocalePlus().getSecondsFromGMT();

Is Device Using 24 hour time and Current Locale AM PM Symbols

final is24HourTime = await LocalePlus().is24HourTime();
final amSymbol = await LocalePlus().getAmSymbol();
final pmSymbol = await LocalePlus().getPmSymbol();

Is Device Using Metric System

final usesMetricSystem = await LocalePlus().usesMetricSystem();

Get TimeZone Identifier

final timeZoneIdentifier = await LocalePlus().getTimeZoneIdentifier();

Get First Day Of Week

final firstDayOfWeek = await LocalePlus().getFirstDayOfWeek();

Get Date format pattern

final dateFormatPattern = await LocalePlus().getDateFormatPattern();

Author

Gökberk Bardakçı, Uygar İşiçelik

Contributors

Bent Engbers, Renat Shakhmatov, Giovanni Lattanzio, Gökhan Çavuş

License

LocalePlus is available under the MIT license. See the LICENSE file for more info.

카테고리

의존성

의존성 목록 3 개

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.