From 45c54c08e2bee5f08a707ebdba02d651bee44de8 Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Tue, 6 Apr 2021 09:46:31 -0700 Subject: [PATCH] Add documentation to embedder locale callback (flutter/engine#25437) The FlutterComputePlatformResolvedLocaleCallback does not pass the standard user_data baton. This was an unintentional omission in the original patch. Add documentation to that effect and link to the bug report: https://github.com/flutter/flutter/issues/79826 --- engine/src/flutter/shell/platform/embedder/embedder.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/engine/src/flutter/shell/platform/embedder/embedder.h b/engine/src/flutter/shell/platform/embedder/embedder.h index 97e14e944f..5678455b44 100644 --- a/engine/src/flutter/shell/platform/embedder/embedder.h +++ b/engine/src/flutter/shell/platform/embedder/embedder.h @@ -1121,6 +1121,14 @@ typedef struct { const char* variant_code; } FlutterLocale; +/// Callback that returns the system locale. +/// +/// Embedders that implement this callback should return the `FlutterLocale` +/// from the `supported_locales` list that most closely matches the +/// user/device's preferred locale. +/// +/// This callback does not currently provide the user_data baton. +/// https://github.com/flutter/flutter/issues/79826 typedef const FlutterLocale* (*FlutterComputePlatformResolvedLocaleCallback)( const FlutterLocale** /* supported_locales*/, size_t /* Number of locales*/);