Commit Graph

7 Commits

Author SHA1 Message Date
Devin AI
9f0f668d12 fix: use simpler exception assertion for Python 3.10 compatibility
- Replace pytest.raises match parameter with exc_info and string assertion
- Avoids potential regex matching differences between Python versions
- Should resolve Python 3.10 CI test failure while maintaining test effectiveness

Co-Authored-By: João <joao@crewai.com>
2025-08-03 09:05:11 +00:00
Devin AI
8405122051 fix: correct test structure for Pydantic model validator exception handling
- Fix test_environment_variable_file_not_found to catch exception during I18N() instantiation
- Exception is raised by Pydantic model validator during object creation, not explicit method call
- Resolves Python 3.10 CI test failure

Co-Authored-By: João <joao@crewai.com>
2025-08-03 09:03:14 +00:00
Devin AI
2c87f83dc3 feat: add global i18n configuration via CREWAI_I18N_FILE environment variable
- Add support for CREWAI_I18N_FILE environment variable to globally configure translation files
- Maintain backward compatibility with existing prompt_file parameter
- Priority order: explicit prompt_file > CREWAI_I18N_FILE env var > default en.json
- Add Chinese (zh.json) and Spanish (es.json) translation files for testing
- Add comprehensive tests covering environment variable functionality, priority handling, and error cases
- Resolves issue #3264 by providing global interface to change i18n files

Co-Authored-By: João <joao@crewai.com>
2025-08-03 08:57:20 +00:00
João Moura
0a53ce17a2 small improvements for i18n 2024-05-02 05:00:29 -03:00
João Moura
672b150972 adding initial support for external prompt file 2024-05-02 05:00:29 -03:00
João Moura
60423376cf removing unnecessary test 2024-05-02 02:21:59 -03:00
João Moura
ddb84cc16d Starting i18n language file support 2024-04-01 10:45:17 -03:00