server/content/plugins/f-translate/templates/translation-set-form.php
Ryan McCue 3e7bc6e67b Initial export of the repository
Signed-off-by: Ryan McCue <me@ryanmccue.info>
2025-06-05 11:48:47 +02:00

25 lines
1.2 KiB
PHP

<dl>
<dt><label for="set[locale]"><?php _e( 'Locale', 'glotpress' ); ?></label></dt>
<dd>
<?php echo gp_locales_dropdown( 'set[locale]', $set->locale ); ?>
<a href="#" id="copy"><?php _e( 'Use as name', 'glotpress' ); ?></a>
</dd>
<dt><label for="set[name]"><?php _e( 'Name', 'glotpress' ); ?></label></dt>
<dd><input type="text" name="set[name]" value="<?php echo esc_html( $set->name ); ?>" id="set[name]"></dd>
<!-- TODO: make slug edit WordPress style -->
<dt><label for="set[slug]"><?php _e( 'Slug', 'glotpress' ); ?></label></dt>
<dd><input type="text" name="set[slug]" value="<?php echo esc_html( $set->slug? $set->slug : 'default' ); ?>" id="set[slug]"></dd>
<dt><label for="set[project_id]"><?php _e( 'Project (ID)', 'glotpress' ); ?></label></dt>
<dd><input type="text" name="set[project_id]" value="<?php echo esc_attr( $set->project_id ); ?>" id="set[project_id]">
</dl>
<?php echo gp_js_focus_on( 'set[locale]' ) . "\n"; ?>
<script type="text/javascript">
jQuery('#copy').click(function() {
var text = jQuery('#set\\[locale\\] option:selected').html().replace(/^\S+\s+\S+\s+/, '').replace(/&mdash|—/, '');
jQuery('#set\\[name\\]').val(text);
return false;
});
</script>