You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|[XliffSchemaValidator](docs/validators.md#xliffschemavalidator)| Validates XLIFF against XML schemas |
72
75
73
-
View detailed [documentation](docs/validators.md) with examples.
74
-
75
-
### Validator-Specific Configuration
76
-
77
-
Some validators support additional configuration options. For detailed configuration instructions and examples, see [Validator Configuration](docs/validator-configuration.md).
76
+
View detailed [validator documentation](docs/validators.md) with examples.
Copy file name to clipboardExpand all lines: docs/file-detector.md
+16-56Lines changed: 16 additions & 56 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,15 +2,23 @@
2
2
3
3
This document provides comprehensive information about supported translation file formats and how the validator detects and groups related translation files across different languages.
@@ -87,9 +89,7 @@ The Composer Translation Validator supports multiple translation file formats co
87
89
88
90
File Detectors group translation files that represent the same content in different languages. The validator supports three detection strategies for different project layouts.
89
91
90
-
### Available File Detectors
91
-
92
-
#### PrefixFileDetector
92
+
### PrefixFileDetector
93
93
Groups files where the language code appears as a **prefix**.
94
94
95
95
- **Pattern**: `{lang}.{name}.{ext}` or `{name}.{ext}`
@@ -98,7 +98,7 @@ Groups files where the language code appears as a **prefix**.
98
98
- **Example**: `en.messages.xlf`, `de.messages.xlf` → grouped as `messages.xlf`
99
99
- **Framework Context**: Common in TYPO3 where the default language file has no prefix
100
100
101
-
#### SuffixFileDetector
101
+
### SuffixFileDetector
102
102
Groups files where the language code appears as a **suffix**.
103
103
104
104
- **Pattern**: `{name}.{lang}.{ext}`
@@ -107,7 +107,7 @@ Groups files where the language code appears as a **suffix**.
107
107
- **Example**: `messages.en.yaml`, `messages.de.yaml` → grouped as `messages`
108
108
- **Framework Context**: Standard approach in Symfony applications
109
109
110
-
#### DirectoryFileDetector
110
+
### DirectoryFileDetector
111
111
Groups files organized in **language directories**.
112
112
113
113
- **Pattern**: `{lang}/{name}.{ext}`
@@ -253,43 +253,3 @@ file-detectors:
253
253
]
254
254
}
255
255
```
256
-
257
-
## Troubleshooting Common Issues
258
-
259
-
### No Translation Files Detected
260
-
**Symptoms**: Command shows "No translation files found"
261
-
262
-
**Solutions**:
263
-
- Verify file extensions are supported (`.xlf`, `.yaml`, `.json`, `.php`)
264
-
- Check language codes follow supported formats
265
-
- Ensure file naming matches one of the three patterns
266
-
- Use `--verbose` flag to see detection details
267
-
- Try `--recursive` flag for nested directories
268
-
269
-
### Files Not Grouped Correctly
270
-
**Symptoms**: Validators report missing translations when files exist
271
-
272
-
**Solutions**:
273
-
- Ensure consistent naming pattern throughout project
274
-
- Don't mix different detection patterns in the same directory
275
-
- Check for typos in language codes or file names
276
-
- Verify file extensions are identical across language variants
277
-
- Use `--verbose` to see how files are being grouped
278
-
279
-
### Mixed Project Structures
280
-
**Symptoms**: Some files detected, others ignored
281
-
282
-
**Solutions**:
283
-
- Reorganize files to use consistent pattern
284
-
- Configure specific detectors manually
285
-
- Use separate validation runs for different file types
286
-
- Consider splitting translation directories by pattern
287
-
288
-
### Performance with Large Projects
289
-
**Symptoms**: Slow file detection or high memory usage
290
-
291
-
**Solutions**:
292
-
- Use specific paths instead of project root
293
-
- Configure exclude patterns for non-translation directories
294
-
- Limit file detectors to only needed types
295
-
- Use `--recursive` selectively rather than globally
0 commit comments