feat(i18n): French and German localization (phase 5)
- Add full message catalogs and content for French (fr) and German (de) - Implement ASCII canonical slugs for French and German routes - Add language-specific search endpoints (/api/busca/fr, /api/busca/de) - Configure strict 404 responses for /fr/livro and /de/livro - Localize SEO, OpenGraph (fr_FR, de_DE), Twitter and JSON-LD schemas - Add localized code example comments across 14 examples for fr and de - Enable 'fr' and 'de' in ENABLED_LOCALES with root negotiation and redirect - Extend test suite in check-i18n, smoke-imagem and verifica-vazamentos Co-Authored-By: Antigravity <noreply@google.com>
This commit is contained in:
1 parent
7b673aeb4b
commit
7fce46b9e1
104 files changed
+33369
-686
No files matched your search
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Exemplo ESP-RainMaker para ESP32
|
||||
* Dispositivo: Interruptor Inteligente com controle via App e Nuvem
|
||||
*
|
||||
* Dependência (idf_component.yml):
|
||||
* espressif/esp_rainmaker: "^1.4.0"
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
#include "esp_log.h"
|
||||
#include "nvs_flash.h"
|
||||
|
||||
#include <esp_rmaker_core.h>
|
||||
#include <esp_rmaker_standard_params.h>
|
||||
#include <esp_rmaker_standard_devices.h>
|
||||
#include <app_wifi.h>
|
||||
|
||||
static const char *TAG = "app_rainmaker";
|
||||
static esp_rmaker_device_t *switch_device;
|
||||
|
||||
/* Callback acionado quando o usuário altera o estado no App móvel */
|
||||
static esp_err_t write_cb(const esp_rmaker_device_t *dev, const esp_rmaker_param_val_t val, void *priv_data, esp_rmaker_write_ctx_t *ctx)
|
||||
{
|
||||
if (ctx) {
|
||||
ESP_LOGI(TAG, "Comando recebido via %s", esp_rmaker_device_cb_src_to_str(ctx->src));
|
||||
}
|
||||
|
||||
bool state = val.val.b;
|
||||
ESP_LOGI(TAG, "État de l'interrupteur modifié en : %s", state ? "ALLUMÉ" : "ÉTEINT");
|
||||
|
||||
// Met à jour le paramètre dans le cloud et l'application
|
||||
esp_rmaker_param_update_and_report(priv_data, val);
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
void app_main(void)
|
||||
{
|
||||
// Inicialização da memória não-volátil (NVS)
|
||||
esp_err_t err = nvs_flash_init();
|
||||
if (err == ESP_ERR_NVS_NO_FREE_PAGES || err == ESP_ERR_NVS_NEW_VERSION_FOUND) {
|
||||
ESP_ERROR_CHECK(nvs_flash_erase());
|
||||
err = nvs_flash_init();
|
||||
}
|
||||
ESP_ERROR_CHECK(err);
|
||||
|
||||
// Inicializa o provisionamento Wi-Fi
|
||||
app_wifi_init();
|
||||
|
||||
// Configura o nó RainMaker
|
||||
esp_rmaker_config_t rainmaker_cfg = {
|
||||
.enable_time_sync = true,
|
||||
};
|
||||
esp_rmaker_node_t *node = esp_rmaker_node_init(&rainmaker_cfg, "ESP32_SmartSwitch", "Switch");
|
||||
|
||||
// Cria o dispositivo padrão 'Switch'
|
||||
switch_device = esp_rmaker_switch_device_create("Luz Sala", NULL, true);
|
||||
|
||||
// Registra callback de escrita
|
||||
esp_rmaker_device_add_cb(switch_device, write_cb, NULL);
|
||||
esp_rmaker_node_add_device(node, switch_device);
|
||||
|
||||
// Habilita serviços adicionais (OTA e Timezone)
|
||||
esp_rmaker_ota_enable_default();
|
||||
esp_rmaker_timezone_service_enable();
|
||||
|
||||
// Inicia o agente RainMaker
|
||||
esp_rmaker_start();
|
||||
|
||||
// Inicia o provisionamento Wi-Fi via BLE (abre no app oficial RainMaker)
|
||||
app_wifi_start(POP_TYPE_RANDOM);
|
||||
|
||||
ESP_LOGI(TAG, "Nó RainMaker pronto! Escaneie o QR Code no app ESP RainMaker.");
|
||||
}
|
||||
Reference in new issue
Block a user