Skip to content

Update magic constant IDs#3208

Closed
haszi wants to merge 3 commits intophp:masterfrom
haszi:Update-magic-constant-IDs
Closed

Update magic constant IDs#3208
haszi wants to merge 3 commits intophp:masterfrom
haszi:Update-magic-constant-IDs

Conversation

@haszi
Copy link
Contributor

@haszi haszi commented Feb 28, 2024

Update magic constant IDs to "standard" global ID format so these can automatically be linked to by Phd.

I've also added a separate commit with the bash script that I made these changes with so that these can be applied to all translations without burdening the maintainers with manually doing these changes.

haszi added 3 commits February 28, 2024 10:14
Update magic constant IDs to standard global constant ID format.
Remove link to __TRAIT__.
@haszi
Copy link
Contributor Author

haszi commented Feb 29, 2024

The update script is as follows:

#! /bin/bash

# replace <link> with <constant>
\grep -lrE --include='*.xml' '<link linkend="constant\.trait">__TRAIT__<\/link>' | xargs -d '\n' sed -i 's/<link linkend="constant\.trait">__TRAIT__<\/link>/<constant>__TRAIT__<\/constant>/g'

# rename IDs to standard global constant ID format
\grep -lrE --include='*.xml' '"constant\.line"' | xargs -d '\n' sed -i 's/"constant\.line"/"constant\.--line--"/g'
\grep -lrE --include='*.xml' '"constant\.file"' | xargs -d '\n' sed -i 's/"constant\.file"/"constant\.--file--"/g'
\grep -lrE --include='*.xml' '"constant\.dir"' | xargs -d '\n' sed -i 's/"constant\.dir"/"constant\.--dir--"/g'
\grep -lrE --include='*.xml' '"constant\.function"' | xargs -d '\n' sed -i 's/"constant\.function"/"constant\.--function--"/g'
\grep -lrE --include='*.xml' '"constant\.class"' | xargs -d '\n' sed -i 's/"constant\.class"/"constant\.--class--"/g'
\grep -lrE --include='*.xml' '"constant\.trait"' | xargs -d '\n' sed -i 's/"constant\.trait"/"constant\.--trait--"/g'
\grep -lrE --include='*.xml' '"constant\.method"' | xargs -d '\n' sed -i 's/"constant\.method"/"constant\.--method--"/g'
\grep -lrE --include='*.xml' '"constant\.namespace"' | xargs -d '\n' sed -i 's/"constant\.namespace"/"constant\.--namespace--"/g'

@Girgias
Copy link
Member

Girgias commented Feb 29, 2024

Closed as discussed for a different solution

@Girgias Girgias closed this Feb 29, 2024
@haszi haszi deleted the Update-magic-constant-IDs branch March 19, 2024 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants