Skip to content

Commit

Permalink
feat(localization): Create stream_chat_localizations_no.dart (#1218)
Browse files Browse the repository at this point in the history
* Create stream_chat_localizations_no.dart

Added the Norwegian translation for the Stream Chat

* Apply suggestions from code review

* Two spelling errors sneaked in

* fix(localization): cleanup pr

* chore(localization): update readme

* chore(localization): update changelog

Co-authored-by: Sahil Kumar <[email protected]>
Co-authored-by: Salvatore Giordano <[email protected]>
  • Loading branch information
3 people authored Jul 7, 2022
1 parent dd47db0 commit f682e0d
Show file tree
Hide file tree
Showing 4 changed files with 406 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/stream_chat_localizations/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Upcoming

* Added support for [Norwegian](https://github.com/GetStream/stream-chat-flutter/blob/master/packages/stream_chat_localizations/lib/src/stream_chat_localizations_no.dart) locale.

## 3.2.0

✅ Added
Expand Down
5 changes: 5 additions & 0 deletions packages/stream_chat_localizations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ At the moment we support the following languages:
- [Korean](https://github.com/GetStream/stream-chat-flutter/blob/master/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ko.dart)
- [Portuguese](https://github.com/GetStream/stream-chat-flutter/blob/master/packages/stream_chat_localizations/lib/src/stream_chat_localizations_pt.dart)
- [German](https://github.com/GetStream/stream-chat-flutter/blob/master/packages/stream_chat_localizations/lib/src/stream_chat_localizations_de.dart)
- [Norwegian](https://github.com/GetStream/stream-chat-flutter/blob/master/packages/stream_chat_localizations/lib/src/stream_chat_localizations_no.dart)

More languages will be added in the future. Feel free to [contribute](https://github.com/GetStream/stream-chat-flutter/blob/master/CONTRIBUTING.md) to add more languages.

Expand Down Expand Up @@ -77,6 +78,8 @@ class MyApp extends StatelessWidget {
Locale('ja'),
Locale('ko'),
Locale('pt'),
Locale('de'),
Locale('no'),
],
// Add GlobalStreamChatLocalizations.delegates
localizationsDelegates: GlobalStreamChatLocalizations.delegates,
Expand Down Expand Up @@ -123,6 +126,8 @@ Example:
<string>ja</string>
<string>ko</string>
<string>pt</string>
<string>de</string>
<string>no</string>
</array>
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ part 'stream_chat_localizations_pt.dart';

part 'stream_chat_localizations_de.dart';

part 'stream_chat_localizations_no.dart';

/// The set of supported languages, as language code strings.
///
/// The [GlobalStreamChatLocalizations.delegate] can generate localizations for
Expand All @@ -39,6 +41,7 @@ const kStreamChatSupportedLanguages = {
'ko',
'pt',
'de',
'no',
};

/// Creates a [GlobalStreamChatLocalizations] instance for the given `locale`.
Expand Down Expand Up @@ -79,6 +82,8 @@ GlobalStreamChatLocalizations? getStreamChatTranslation(Locale locale) {
return const StreamChatLocalizationsPt();
case 'de':
return const StreamChatLocalizationsDe();
case 'no':
return const StreamChatLocalizationsNo();
default:
return null;
}
Expand Down
Loading

0 comments on commit f682e0d

Please sign in to comment.