# Migration guide for material localized strings

> ReorderableListView's localized strings are moved from material localizations to widgets localizations.




:::important
These breaking change docs are accurate, as of the release
under which they are published. Over time, the
workarounds described here might become inaccurate.
We don't, in general, keep these breaking change docs up
to date as of each release.

这些破坏性改动文档的准确性仅限于其发布时对应的版本。
随着时间的推移，文档中描述的方案可能会逐渐失效。
通常情况下，我们不会在每次发布新版本时都对这些文档进行同步更新。

The [breaking change index file](/release/breaking-changes)
lists the docs created for each release.

[破坏性改动列表](/release/breaking-changes) 
列出了每个版本的文档。

:::


## Summary

`ReorderableListView`'s localized strings were moved from
material localizations to widgets localizations.
These strings were deprecated in material localizations.

## Context

[`ReorderableListView`][] uses these strings to annotate its semantics actions.
To apply the same annotations to [`ReorderableList`][]
and [`SliverReorderableList`][], they need to
access these strings from widgets library.

## Description of change

The [`MaterialLocalizations`][] strings for
`reorderItemToStart`, `reorderItemToEnd`, `reorderItemUp`,
`reorderItemDown`, `reorderItemLeft`, and `reorderItemRight` are deprecated and
replaced by the same strings in [`WidgetsLocalizations`][].

## Migration guide

If you use these strings in your code,
you can access them from `WidgetsLocalizations`instead.

Code before migration:

```dart
MaterialLocalizations.of(context).reorderItemToStart;
```

Code after migration:

```dart
WidgetsLocalizations.of(context).reorderItemToStart;
```

If you override `MaterialLocalizations` or `WidgetsLocalizations`,
make sure to remove the translations from the `MaterialLocalizations`
subclass and move them to the `WidgetsLocalizations` subclass.

Code before migration:

```dart
class MaterialLocalizationsMyLanguage extends MaterialLocalizationsEn {
  // ...
  @override
  String get reorderItemRight => 'my translation';
}
```

Code after migration:

```dart
class MaterialLocalizationsMyLanguage extends MaterialLocalizationsEn {
  // ...
}

class WidgetsLocalizationsMyLanguage extends WidgetsLocalizationsEn {
  // ...
  @override
  String get reorderItemRight => 'my translation';
}
```

## Timeline

Landed in version: v3.10.0-2.0.pre<br>
In stable release: 3.13.0

## References

Relevant PR:

* [PR 124711][]: Deprecates string for
  ReorderableList in material_localizations.

[PR 124711]: https://github.com/flutter/flutter/pull/124711
[`ReorderableListView`]: https://api.flutter-io.cn/flutter/material/ReorderableListView-class.html
[`ReorderableList`]: https://api.flutter-io.cn/flutter/widgets/ReorderableList-class.html
[`SliverReorderableList`]: https://api.flutter-io.cn/flutter/widgets/SliverReorderableList-class.html
[`MaterialLocalizations`]: https://api.flutter-io.cn/flutter/material/MaterialLocalizations-class.html
[`WidgetsLocalizations`]: https://api.flutter-io.cn/flutter/widgets/WidgetsLocalizations-class.html

